Browse Source

Do not allow to set a value of different type to the variable.

pull/50/head
Rafal Kupiec 3 years ago
parent
commit
b5eb268ce1
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      engine/vm.c

+ 9
- 1
engine/vm.c 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;
}
/*


Loading…
Cancel
Save