Check access level for static methods call.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-05-29 19:05:34 +02:00
parent 7732a239ff
commit 1c0ba22c48
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 3 additions and 0 deletions

View File

@ -4336,6 +4336,9 @@ static sxi32 VmByteCodeExec(
} else if((pMeth->iFlags & PH7_CLASS_ATTR_STATIC) == 0) { } else if((pMeth->iFlags & PH7_CLASS_ATTR_STATIC) == 0) {
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Attempt to call statically a non-static method '%z::%z()'", PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Attempt to call statically a non-static method '%z::%z()'",
&pClass->sName, &sName); &pClass->sName, &sName);
} else if(!VmClassMemberAccess(&(*pVm), pClass, pMeth->iProtection)) {
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Method '%z::%z()' is inaccessible due to its protection level",
&pClass->sName, &sName);
} else { } else {
/* Push method name on the stack */ /* Push method name on the stack */
PH7_MemObjRelease(pTos); PH7_MemObjRelease(pTos);