Do not check parameters passed to constructor.
The build was successful. Details

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.
This commit is contained in:
Rafal Kupiec 2019-04-17 12:18:55 +02:00
parent 0268a95169
commit 9a82298451
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 0 additions and 16 deletions

View File

@ -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) {