From 8cbfca2bc97b349f3c9bf6926cc14ccf3f8ab2fe Mon Sep 17 00:00:00 2001 From: belliash Date: Sun, 12 Aug 2018 12:27:15 +0200 Subject: [PATCH] Do not overload entry point --- engine/vm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/engine/vm.c b/engine/vm.c index 1ba0ecb..23c46c1 100644 --- a/engine/vm.c +++ b/engine/vm.c @@ -5103,7 +5103,7 @@ static sxi32 VmByteCodeExec( break; } /* - * OP_CALL P1 * * + * OP_CALL P1 P2 * * Call a PHP or a foreign function and push the return value of the called * function on the stack. */ @@ -5244,8 +5244,10 @@ static sxi32 VmByteCodeExec( PH7_MemObjRelease(pTos); break; } - /* Always select an appropriate function to call */ - pVmFunc = VmOverload(&(*pVm), pVmFunc, pArg, (int)(pTos - pArg)); + /* Select an appropriate function to call, if not entry point */ + if(pInstr->iP2 == 0) { + pVmFunc = VmOverload(&(*pVm), pVmFunc, pArg, (int)(pTos - pArg)); + } /* Extract the formal argument set */ aFormalArg = (ph7_vm_func_arg *)SySetBasePtr(&pVmFunc->aArgs); /* Create a new VM frame */