Load data from array/object only if there is anything stored.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2018-09-24 11:47:30 +02:00
parent 59fda6d797
commit f72d6c3922
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 8 additions and 6 deletions

View File

@ -794,12 +794,14 @@ PH7_PRIVATE sxi32 PH7_MemObjStore(ph7_value *pSrc, ph7_value *pDest) {
PH7_PRIVATE sxi32 PH7_MemObjLoad(ph7_value *pSrc, ph7_value *pDest) { PH7_PRIVATE sxi32 PH7_MemObjLoad(ph7_value *pSrc, ph7_value *pDest) {
SyMemcpy((const void *) & (*pSrc), &(*pDest), SyMemcpy((const void *) & (*pSrc), &(*pDest),
sizeof(ph7_value) - (sizeof(ph7_vm *) + sizeof(SyBlob) + sizeof(sxu32))); sizeof(ph7_value) - (sizeof(ph7_vm *) + sizeof(SyBlob) + sizeof(sxu32)));
if(pSrc->iFlags & MEMOBJ_HASHMAP) { if(pSrc->x.pOther) {
/* Increment reference count */ if(pSrc->iFlags & MEMOBJ_HASHMAP) {
((ph7_hashmap *)pSrc->x.pOther)->iRef++; /* Increment reference count */
} else if(pSrc->iFlags & MEMOBJ_OBJ) { ((ph7_hashmap *)pSrc->x.pOther)->iRef++;
/* Increment reference count */ } else if(pSrc->iFlags & MEMOBJ_OBJ) {
((ph7_class_instance *)pSrc->x.pOther)->iRef++; /* Increment reference count */
((ph7_class_instance *)pSrc->x.pOther)->iRef++;
}
} }
if(SyBlobLength(&pDest->sBlob) > 0) { if(SyBlobLength(&pDest->sBlob) > 0) {
SyBlobRelease(&pDest->sBlob); SyBlobRelease(&pDest->sBlob);