Throw a warning when trying to typecast to resource.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-02-13 13:22:30 +01:00
parent a7b4c6e880
commit 4af3220018
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 1 additions and 0 deletions

View File

@ -448,6 +448,7 @@ PH7_PRIVATE sxi32 PH7_MemObjToCallback(ph7_value *pObj) {
}
PH7_PRIVATE sxi32 PH7_MemObjToResource(ph7_value *pObj) {
sxi32 rc = SXRET_OK;
PH7_VmThrowError(&(*pObj->pVm), PH7_CTX_WARNING, "Unsafe type casting condition, assuming default value");
if((pObj->iFlags & MEMOBJ_RES) == 0) {
pObj->x.iVal = 0;
}