Finally, do it the proper way. This should fix all problems with accessing class attributes, at least I hope so.
The build was successful.
Details
The build was successful.
Details
This commit is contained in:
parent
519f5050b7
commit
1f7e14fd7a
42
engine/vm.c
42
engine/vm.c
|
@ -4203,20 +4203,44 @@ static sxi32 VmByteCodeExec(
|
||||||
} else {
|
} else {
|
||||||
/* Attribute access */
|
/* Attribute access */
|
||||||
VmClassAttr *pObjAttr = 0;
|
VmClassAttr *pObjAttr = 0;
|
||||||
|
ph7_class_attr *pAttr = 0;
|
||||||
SyHashEntry *pEntry;
|
SyHashEntry *pEntry;
|
||||||
/* Extract the target attribute */
|
|
||||||
if(sName.nByte > 0) {
|
if(sName.nByte > 0) {
|
||||||
SyHashResetLoopCursor(&pThis->hAttr);
|
/* Extract the target attribute */
|
||||||
while((pEntry = SyHashGetNextEntry(&pThis->hAttr)) != 0) {
|
if(pNos->iFlags != MEMOBJ_PARENTOBJ) {
|
||||||
pObjAttr = (VmClassAttr *)pEntry->pUserData;
|
pAttr = PH7_ClassExtractAttribute(pClass, sName.zString, sName.nByte);
|
||||||
if(SyStrncmp(pObjAttr->pAttr->sName.zString, sName.zString, sName.nByte) == 0) {
|
}
|
||||||
if(pNos->iFlags != MEMOBJ_PARENTOBJ && pObjAttr->pAttr->pClass == pClass) {
|
if(pAttr == 0) {
|
||||||
break;
|
/* Browse hashtable from the beginning */
|
||||||
} else if(pObjAttr->pAttr->pClass != pClass) {
|
SyHashResetLoopCursor(&pClass->hDerived);
|
||||||
|
/* Search for appropriate class member */
|
||||||
|
SyHashEntry *pEntry;
|
||||||
|
while((pEntry = SyHashGetNextEntry(&pClass->hDerived)) != 0) {
|
||||||
|
pDerived = (ph7_class *) pEntry->pUserData;
|
||||||
|
SyHashResetLoopCursor(&pDerived->hAttr);
|
||||||
|
while((pEntry = SyHashGetNextEntry(&pDerived->hAttr)) != 0) {
|
||||||
|
pAttr = (ph7_class_attr *)pEntry->pUserData;
|
||||||
|
if(SyStrncmp(pAttr->sName.zString, sName.zString, sName.nByte) == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
pAttr = 0;
|
||||||
|
}
|
||||||
|
if(pAttr) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pObjAttr = 0;
|
}
|
||||||
|
if(pAttr) {
|
||||||
|
SyHashResetLoopCursor(&pThis->hAttr);
|
||||||
|
while((pEntry = SyHashGetNextEntry(&pThis->hAttr)) != 0) {
|
||||||
|
pObjAttr = (VmClassAttr *)pEntry->pUserData;
|
||||||
|
if(pObjAttr->pAttr->pClass == pAttr->pClass) {
|
||||||
|
if(SyStrncmp(pObjAttr->pAttr->sName.zString, sName.zString, sName.nByte) == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pObjAttr = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(pObjAttr == 0) {
|
if(pObjAttr == 0) {
|
||||||
|
|
Loading…
Reference in New Issue