TScript Bugfix

If the statement is a terminating statement on slot assignment (such as %var[%i]++;), the stack has to be popped everytime slot arrays are used regardless of the expression type.
This commit is contained in:
Jeff Hutchinson 2024-01-30 17:56:04 -05:00
parent 3d4b7b469c
commit 0d743c8bb9
2 changed files with 109 additions and 1 deletions

View file

@ -1370,7 +1370,7 @@ U32 SlotAssignOpNode::compile(CodeStream& codeStream, U32 ip, TypeReq type)
if (arrayExpr)
{
codeStream.emit(OP_SETCURFIELD_ARRAY);
if (subType == TypeReqNone)
if (subType == TypeReqNone || type == TypeReqNone)
codeStream.emit(OP_POP_STK);
}
codeStream.emit((subType == TypeReqFloat) ? OP_LOADFIELD_FLT : OP_LOADFIELD_UINT);