Fix segmentation fault when trying to store a value under next index into an array.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-03-09 13:25:13 +01:00
parent 4af3220018
commit 7eba38a633
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 9 additions and 0 deletions

View File

@ -2447,6 +2447,15 @@ static sxi32 VmByteCodeExec(
PH7_MemObjRelease(pTos);
} else {
pObj = VmExtractMemObj(&(*pVm), &sName, FALSE, TRUE);
if(pInstr->iP2 & MEMOBJ_HASHMAP) {
ph7_hashmap *pMap;
pMap = PH7_NewHashmap(&(*pVm), 0, 0);
if(pMap == 0) {
PH7_VmMemoryError(&(*pVm));
goto Abort;
}
pObj->x.pOther = pMap;
}
MemObjSetType(pObj, pInstr->iP2);
}
pTos->nIdx = SXU32_HIGH; /* Mark as constant */