mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-27 06:12:19 +00:00
- fixed the early-outs for empty functions in the VM caller.
OP_RET should not be used as an absolute number here.
This commit is contained in:
parent
622b4a6457
commit
3cced6c7cc
1 changed files with 2 additions and 2 deletions
|
@ -446,11 +446,11 @@ int VMFrameStack::Call(VMFunction *func, VMValue *params, int numparams, VMRetur
|
|||
auto code = static_cast<VMScriptFunction *>(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<VMScriptFunction *>(func)->KonstD[0]);
|
||||
|
|
Loading…
Reference in a new issue