With changes in behavior with warn=5, ValidateNoReferenceToReference would sometimes fail if the local variable value was not yet added to the LocalVariableStore. This checks the type of the variable pointed to instead of looking for it's dataflow tracked value in the LocalVariableStore cache.
Also, instead of validating the local variable state on every instruction, we can limit it to places where locals is modified or passed outside of the function.
With changes in behavior with warn=5, ValidateNoReferenceToReference would sometimes fail if the local variable value was not yet added to the LocalVariableStore. This checks the type of the variable pointed to instead of looking for it's dataflow tracked value in the LocalVariableStore cache.
Also, instead of validating the local variable state on every instruction, we can limit it to places where
locals
is modified or passed outside of the function.