Uses a signed char instead of a char for opcode stack offset. On some platforms like ARM, char is unsigned by default

This fixes #311 where a memory corruption that occurred in ARM was caused because of insufficient ScriptVM stack size. The stack size was incorrectly calculated because the stack offset was using unsigned values instead of signed in ARM.
This commit is contained in:
smallmodel committed 2024-06-22 19:18:08 +02:00
1 parent 2f48ca6adb
commit 13197acb3a
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -77,7 +77,7 @@ unsigned char ScriptCompiler::PrevOpcode()
return prev_opcodes[prev_opcode_pos].opcode;
}
char ScriptCompiler::PrevVarStackOffset()
signed char ScriptCompiler::PrevVarStackOffset()
{
return prev_opcodes[prev_opcode_pos].VarStackOffset;
}