You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[FileCheck] Fix --enable-var-scope for numvars after reassignment (#157158)
* When `--enable-var-scope` is active,
`lib/FileCheck.cpp#clearLocalVars` gets called.
* That function loops through `GlobalNumericVariableTable` and then
calls `NumericVariable::clear` on most items. It also removes them from
`GlobalNumericVariableTable`.
* When reassigning an already cleared variable, `Pattern::match` calls
`NumericVariable::setValue`, but it doesn't reinsert it into
`GlobalNumericVariableTable`. Therefore, the next time `clearLocalVars`
is called, it won't be able to loop through the variables.
Fix it by reinserting them in `GlobalNumericVariableTable` inside
`Pattern::match`.
Co-authored-by: Thomas Preud'homme <thomas.preudhomme@arm.com>
0 commit comments