Fix segmentation fault when trying to access array element.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-03-29 09:09:51 +01:00
parent 140bd35f93
commit 47cca096bc
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 9 additions and 0 deletions

View File

@ -695,6 +695,15 @@ PH7_PRIVATE sxi32 PH7_VmCreateClassInstanceFrame(
SyMemBackendPoolFree(&pVm->sAllocator, pVmAttr);
return SXERR_MEM;
}
if(pAttr->nType & MEMOBJ_HASHMAP) {
ph7_hashmap *pMap;
pMap = PH7_NewHashmap(&(*pVm), 0, 0);
if(pMap == 0) {
SyMemBackendPoolFree(&pVm->sAllocator, pMap);
return SXERR_MEM;
}
pMemObj->x.pOther = pMap;
}
MemObjSetType(pMemObj, pAttr->nType);
pVmAttr->nIdx = pMemObj->nIdx;
if(SySetUsed(&pAttr->aByteCode) > 0) {