Back

LL033

Tag property misuse

Object Pascal — Delphi & Free Pascal
Info
Delphi

The Tag property is untyped and fragile, leading to hard-to-trace bugs when used for logic

the Tag property is untyped and fragile, leading to hard-to-trace bugs when used for logic.

Why this severity

the Tag property is untyped and fragile, leading to hard-to-trace bugs when used for logic.


Known false positives

simple identifier storage in small utility forms with no risk of collision.

Remediation example

type
  TButtonData = class
    OrderId: Integer;
  end;
// Store: Button.Tag := NativeInt(TButtonData.Create);

Reconnecting… Connection lost. Reload