checkParamArgumentEscape

Function parameter par is being initialized to arg, and par may escape. Detect if scoped values can escape this way. Print error messages when these are detected.

Parameters

sc Scope*

used to determine current function and module

fdc FuncDeclaration

function being called, null if called indirectly

parId Identifier

name of function parameter for error messages

vPar VarDeclaration

VarDeclaration corresponding to par

parStc STC

storage classes of function parameter (may have added scope from pure)

arg Expression

initializer for param

assertmsg bool

true if the parameter is the msg argument to assert(bool, msg).

gag bool

do not print error messages

Return Value

Type: bool

true if pointers to the stack can escape via assignment

Meta