Do not emit warning when assigning NULL to resource.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-04-05 11:42:40 +02:00
parent 5765ff3fd6
commit a1151d598b
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 3 additions and 1 deletions

View File

@ -506,7 +506,9 @@ 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_NULL) == 0) {
PH7_VmThrowError(&(*pObj->pVm), PH7_CTX_WARNING, "Unsafe type casting condition, assuming default value");
}
if((pObj->iFlags & MEMOBJ_RES) == 0) {
pObj->x.iVal = 0;
}