Allow to assign NULL to array.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-04-02 19:58:12 +02:00
parent aaef03396c
commit 66a7e957c9
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 6 additions and 4 deletions

View File

@ -395,8 +395,9 @@ PH7_PRIVATE sxi32 PH7_MemObjSafeStore(ph7_value *pSrc, ph7_value *pDest) {
PH7_MemObjStore(pSrc, pDest);
pDest->iFlags |= MEMOBJ_MIXED;
} else if(pSrc->iFlags & MEMOBJ_NULL) {
/* Temporarily do no allow to assign a NULL value to array */
return SXERR_NOMATCH;
PH7_MemObjToHashmap(pSrc);
MemObjSetType(pSrc, pDest->iFlags);
PH7_MemObjStore(pSrc, pDest);
} else {
return SXERR_NOMATCH;
}
@ -414,8 +415,9 @@ PH7_PRIVATE sxi32 PH7_MemObjSafeStore(ph7_value *pSrc, ph7_value *pDest) {
} else if((pDest->iFlags & MEMOBJ_HASHMAP)) {
/* [] */
if(pSrc->iFlags & MEMOBJ_NULL) {
/* Temporarily do no allow to assign a NULL value to array */
return SXERR_NOMATCH;
PH7_MemObjToHashmap(pSrc);
MemObjSetType(pSrc, pDest->iFlags);
PH7_MemObjStore(pSrc, pDest);
} else if(pSrc->iFlags & MEMOBJ_HASHMAP) {
if(PH7_HashmapCast(pSrc, pDest->iFlags ^ MEMOBJ_HASHMAP) != SXRET_OK) {
return SXERR_NOMATCH;