Browse Source

Attempt to fix methods visibility mechanism.

release/v0.1
Rafal Kupiec 2 years ago
parent
commit
4d1c246a65
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      engine/vm.c

+ 2
- 2
engine/vm.c View File

@ -4193,9 +4193,9 @@ static sxi32 VmByteCodeExec(
&pClass->sName, &sName
);
} else {
if(pMeth->iProtection == PH7_CLASS_PROT_PRIVATE && (pNos->iFlags == MEMOBJ_BASEOBJ || pNos->iFlags == MEMOBJ_PARENTOBJ)) {
if(!VmClassMemberAccess(&(*pVm), pMeth->sFunc.pClass, &sName, pMeth->iProtection, FALSE)) {
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR,
"Access to the class method '%z->%z()' is forbidden", &pClass->sName, &sName);
"Access to the class method '%z->%z()' is forbidden", &pMeth->sFunc.pClass->sName, &sName);
}
/* Push method name on the stack */
PH7_MemObjRelease(pTos);


Loading…
Cancel
Save