Fixed OPCODE_STORE_FIELD_REF incorrectly not skipping field on exception

It would cause invalid opcode afterwards.
This commit is contained in:
smallmodel committed 2023-11-14 00:06:23 +01:00
1 parent eeb697570d
commit befcedcf58
1 file changed
+1 -1
+1 -1
View File
@@ -1512,7 +1512,6 @@ void ScriptVM::Execute(ScriptVariable *data, int dataSize, str label)
if (listener == nullptr) {
fieldNameIndex = fetchActualOpcodeValue<op_name_t>();
skipField();
ScriptError(
"Field '%s' applied to NULL listener", Director.GetString(fieldNameIndex).c_str()
);
@@ -1527,6 +1526,7 @@ void ScriptVM::Execute(ScriptVariable *data, int dataSize, str label)
} catch (...) {
ScriptVariable *const pTop = m_VMStack.GetTopPtr();
pTop->setRefValue(pTop);
skipField();
throw;
}
break;