From 3cced6c7cccd329f351355b2e26f25dad349fba3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 18 Mar 2017 21:31:43 +0100 Subject: [PATCH] - fixed the early-outs for empty functions in the VM caller. OP_RET should not be used as an absolute number here. --- src/scripting/vm/vmframe.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripting/vm/vmframe.cpp b/src/scripting/vm/vmframe.cpp index 44bf46f23..1eeff688b 100644 --- a/src/scripting/vm/vmframe.cpp +++ b/src/scripting/vm/vmframe.cpp @@ -446,11 +446,11 @@ int VMFrameStack::Call(VMFunction *func, VMValue *params, int numparams, VMRetur auto code = static_cast(func)->Code; // handle empty functions consisting of a single return explicitly so that empty virtual callbacks do not need to set up an entire VM frame. // code cann be null here in case of some non-fatal DECORATE errors. - if (code == nullptr || code->word == 0x0080804e) + if (code == nullptr || code->word == (0x00808000|OP_RET)) { return 0; } - else if (code->word == 0x0004804e) + else if (code->word == (0x00048000|OP_RET)) { if (numresults == 0) return 0; results[0].SetInt(static_cast(func)->KonstD[0]);