Consider private attributes to be accessed. Fix access check.
The build was successful.
Details
The build was successful.
Details
This commit is contained in:
parent
c206011c95
commit
1bf5c3a8a2
|
@ -4215,7 +4215,7 @@ static sxi32 VmByteCodeExec(
|
||||||
if(SyStrncmp(pObjAttr->pAttr->sName.zString, sName.zString, sName.nByte) == 0) {
|
if(SyStrncmp(pObjAttr->pAttr->sName.zString, sName.zString, sName.nByte) == 0) {
|
||||||
if(pNos->iFlags != MEMOBJ_PARENTOBJ && pObjAttr->pAttr->pClass == pClass) {
|
if(pNos->iFlags != MEMOBJ_PARENTOBJ && pObjAttr->pAttr->pClass == pClass) {
|
||||||
break;
|
break;
|
||||||
} else if(pNos->iFlags != MEMOBJ_BASEOBJ && pObjAttr->pAttr->iProtection != PH7_CLASS_PROT_PRIVATE) {
|
} else if(pNos->iFlags != MEMOBJ_BASEOBJ) {
|
||||||
SyHashEntry *pDerived = SyHashGet(&pClass->hDerived, (const void *)pObjAttr->pAttr->pClass->sName.zString, pObjAttr->pAttr->pClass->sName.nByte);
|
SyHashEntry *pDerived = SyHashGet(&pClass->hDerived, (const void *)pObjAttr->pAttr->pClass->sName.zString, pObjAttr->pAttr->pClass->sName.nByte);
|
||||||
if(pDerived != 0) {
|
if(pDerived != 0) {
|
||||||
ph7_class *pSub = (ph7_class *)pDerived->pUserData;
|
ph7_class *pSub = (ph7_class *)pDerived->pUserData;
|
||||||
|
@ -4244,7 +4244,7 @@ static sxi32 VmByteCodeExec(
|
||||||
if(pObjAttr) {
|
if(pObjAttr) {
|
||||||
ph7_value *pValue = 0; /* cc warning */
|
ph7_value *pValue = 0; /* cc warning */
|
||||||
/* Check attribute access */
|
/* Check attribute access */
|
||||||
if(VmClassMemberAccess(&(*pVm), pClass, pObjAttr->pAttr->iProtection)) {
|
if(VmClassMemberAccess(&(*pVm), pObjAttr->pAttr->pClass, pObjAttr->pAttr->iProtection)) {
|
||||||
/* Load attribute */
|
/* Load attribute */
|
||||||
pValue = (ph7_value *)SySetAt(&pVm->aMemObj, pObjAttr->nIdx);
|
pValue = (ph7_value *)SySetAt(&pVm->aMemObj, pObjAttr->nIdx);
|
||||||
if(pValue) {
|
if(pValue) {
|
||||||
|
@ -4266,7 +4266,7 @@ static sxi32 VmByteCodeExec(
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR,
|
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR,
|
||||||
"Class attribute '%z->%z' is inaccessible due to its protection level", &pClass->sName, &pObjAttr->pAttr->sName);
|
"Class attribute '%z->%z' is inaccessible due to its protection level", &pObjAttr->pAttr->pClass->sName, &pObjAttr->pAttr->sName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Safely unreference the object */
|
/* Safely unreference the object */
|
||||||
|
|
Loading…
Reference in New Issue