Browse Source

Store class pointer in attribute during installation.

release/v0.1
Rafal Kupiec 1 year ago
parent
commit
9fd61a207b
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      engine/oop.c

+ 1
- 1
engine/oop.c View File

@ -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;
}

Loading…
Cancel
Save