Fix global variables not being able to be used inside of a foreach$ loop.

This commit is contained in:
Jeff Hutchinson 2019-06-02 23:06:59 -04:00 committed by Lukas Aldershaab
parent 76c5e30869
commit 2bf3c8384c

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)
{