From 9a822984516c8dd5bca435e0f9160c3be0c72344 Mon Sep 17 00:00:00 2001 From: belliash Date: Wed, 17 Apr 2019 12:18:55 +0200 Subject: [PATCH] Do not check parameters passed to constructor. There is no need to check parameters passed to constructor and emit a notice, because PH7_VmCallClassMethod() does the job. It tries to find a matching method if overloaded and checks all arguments passed. In case of any problems, it emits E_ERROR. --- engine/vm.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/engine/vm.c b/engine/vm.c index d24a1d8..df64b24 100644 --- a/engine/vm.c +++ b/engine/vm.c @@ -4536,22 +4536,6 @@ static sxi32 VmByteCodeExec( SySetPut(&aArg, (const void *)&pArg); pArg++; } - if(pVm->bErrReport) { - ph7_vm_func_arg *pFuncArg; - sxu32 n; - n = SySetUsed(&aArg); - /* Emit a notice for missing arguments */ - while(n < SySetUsed(&pCons->sFunc.aArgs)) { - pFuncArg = (ph7_vm_func_arg *)SySetAt(&pCons->sFunc.aArgs, n); - if(pFuncArg) { - if(SySetUsed(&pFuncArg->aByteCode) < 1) { - PH7_VmThrowError(&(*pVm), PH7_CTX_NOTICE, "Missing constructor argument %u($%z) for class '%z'", - n + 1, &pFuncArg->sName, &pClass->sName); - } - } - n++; - } - } PH7_VmCallClassMethod(&(*pVm), pNew, pCons, 0, (int)SySetUsed(&aArg), (ph7_value **)SySetBasePtr(&aArg)); /* TICKET 1433-52: Unsetting $this in the constructor body */ if(pNew->iRef < 1) {