From 7c52e35a0ff717f7540962e85684f4da76009e9c Mon Sep 17 00:00:00 2001 From: Ivan Mogilko Date: Sat, 14 Dec 2024 04:36:47 +0300 Subject: [PATCH] Engine: fix incorrect loop condition in GetStackPtrOffsetRw() --- Engine/script/cc_instance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/script/cc_instance.cpp b/Engine/script/cc_instance.cpp index 782b3a72d4..fcf8f67dbd 100644 --- a/Engine/script/cc_instance.cpp +++ b/Engine/script/cc_instance.cpp @@ -2241,7 +2241,7 @@ RuntimeScriptValue ccInstance::GetStackPtrOffsetRw(const int32_t rw_offset) { int32_t total_off = 0; RuntimeScriptValue *stack_entry = _registers[SREG_SP].RValue; - while (total_off < rw_offset && stack_entry >= _stackBegin) + while (total_off < rw_offset && stack_entry > _stackBegin) { stack_entry--; total_off += stack_entry->Size;