Distinguish methods from attributes.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-05-09 13:43:01 +02:00
parent d3d3dff673
commit 5e7d5957e2
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 3 additions and 8 deletions

View File

@ -4593,14 +4593,9 @@ static sxi32 VmByteCodeExec(
/* Check if the call is allowed */
pMeth = PH7_ClassExtractMethod(pSelf, pVmFunc->sName.zString, pVmFunc->sName.nByte);
if(pMeth && pMeth->iProtection != PH7_CLASS_PROT_PUBLIC) {
if(!VmClassMemberAccess(&(*pVm), pSelf, &pVmFunc->sName, pMeth->iProtection, TRUE)) {
/* Pop given arguments */
if(pInstr->iP1 > 0) {
VmPopOperand(&pTos, pInstr->iP1);
}
/* Assume a null return value so that the program continue it's execution normally */
PH7_MemObjRelease(pTos);
break;
if(!VmClassMemberAccess(&(*pVm), pSelf, &pVmFunc->sName, pMeth->iProtection, FALSE)) {
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR,
"Access to the class method '%z->%z()' is forbidden", &pSelf->sName, &pVmFunc->sName);
}
}
}