SA0017: Non-regular assignments

Detects assignments to pointers that are neither addresses (ADR operator, pointer variables) nor constants 0

Justification: If a pointer contains a value that is not a valid address, then an access violation exception occurs when dereferencing the pointer.

Importance: High

Example

PROGRAM PLC_PRG
VAR
        pInt : POINTER TO INT;
        dwAddress : DWORD;
END_VAR
dwAddress := dwAddress + DWORD#1;
pInt := dwAddress; // SA0017

--> SA0017: Nicht reguläre Zuweisung