Store class pointer in attribute during installation.
已通過所有檢查
The build was successful.

This commit is contained in:
Rafal Kupiec 2019-05-21 08:42:45 +02:00
父節點 1acbd21caf
當前提交 9fd61a207b
簽署人: belliash
GPG 金鑰 ID: 4E829243E0CFE6B4

查看文件

@ -84,7 +84,6 @@ PH7_PRIVATE ph7_class_attr *PH7_NewClassAttr(ph7_vm *pVm, ph7_class *pClass, con
}
SyStringInitFromBuf(&pAttr->sName, zName, pName->nByte);
/* Initialize fields */
pAttr->pClass = pClass;
SySetInit(&pAttr->aByteCode, &pVm->sAllocator, sizeof(VmInstr));
pAttr->iProtection = iProtection;
pAttr->nIdx = SXU32_HIGH;
@ -182,6 +181,7 @@ PH7_PRIVATE ph7_class_attr *PH7_ClassExtractAttribute(ph7_class *pClass, const c
PH7_PRIVATE sxi32 PH7_ClassInstallAttr(ph7_class *pClass, ph7_class_attr *pAttr) {
SyString *pName = &pAttr->sName;
sxi32 rc;
pAttr->pClass = pClass;
rc = SyHashInsert(&pClass->hAttr, (const void *)pName->zString, pName->nByte, pAttr);
return rc;
}