Merge pull request #327 from lukaspj/fix/interpreter-foreach

Fix global variables not being able to be used inside of a foreach$ loop
This commit is contained in:
Brian Roberts 2020-10-03 15:59:20 -05:00 committed by GitHub
commit 6dedf6330b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2898,7 +2898,10 @@ OPCodeReturn CodeInterpreter::op_iter_begin(U32 &ip)
IterStackRecord& iter = iterStack[_ITER];
iter.mVariable = gEvalState.getCurrentFrame().add(varName);
if (varName[0] == '$')
iter.mVariable = gEvalState.globalVars.add(varName);
else
iter.mVariable = gEvalState.getCurrentFrame().add(varName);
if (iter.mIsStringIter)
{