Do not allow to set a value of different type to the variable.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2018-09-24 19:17:46 +02:00
parent 5f2f9d9c08
commit b5eb268ce1
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 9 additions and 1 deletions

View File

@ -2731,7 +2731,15 @@ static sxi32 VmByteCodeExec(
PH7_MemObjRelease(&pTos[1]);
}
/* Perform the store operation */
PH7_MemObjStore(pTos, pObj);
if(pObj->iFlags == pTos->iFlags) {
PH7_MemObjStore(pTos, pObj);
} else if(pObj->iFlags & MEMOBJ_MIXED) {
PH7_MemObjStore(pTos, pObj);
pObj->iFlags |= MEMOBJ_MIXED;
} else {
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR,
"Cannot assign a value of incompatible type to variable '$%z'", &sName);
}
break;
}
/*