sonar-openedge
sonar-openedge copied to clipboard
Variable usage memptr
The following code is falsely flagged in two places:
define variable mp as memptr no-undo. // read but never assigned
run bar ( mp ).
message get-long( mp, 1 ).
procedure bar:
define input parameter i_mp as memptr no-undo. // assigned but never read
set-size( i_mp ) = 4.
put-long( i_mp, 1 ) = 858.
end procedure.
Reproduced
A similar case:
define temp-table tt no-undo field cc as character.
define variable mp as memptr no-undo. // variable mp is read but never assigned
temp-table tt:write-json( 'memptr':u, mp ). // <-- "assign"
temp-table tt:write-json( 'memptr':u, mp ). // <-- "assign"
run foo ( mp ).