From bca4d1a2fadb508395de19572d67f6497a5d138c Mon Sep 17 00:00:00 2001 From: belliash Date: Tue, 7 Aug 2018 19:48:12 +0200 Subject: [PATCH] Always select an appropriate function to call It does not matter, if we call function, anonymouss function or method. It is important to select appropriate function to call everytime. Otherwise, if function or method is not overloaded it will call it regardless the number and type of parameters it takes. type --- engine/vm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/engine/vm.c b/engine/vm.c index 320b6c1..70a5f6a 100644 --- a/engine/vm.c +++ b/engine/vm.c @@ -5233,10 +5233,8 @@ static sxi32 VmByteCodeExec( PH7_MemObjRelease(pTos); break; } - if(pVmFunc->pNextName) { - /* Function is candidate for overloading,select the appropriate function to call */ - pVmFunc = VmOverload(&(*pVm), pVmFunc, pArg, (int)(pTos - pArg)); - } + /* Always select an appropriate function to call */ + 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 */