Allow NULL to be assigned to any type of variable. NULL will be automatically typecasted to any data type, thus setting ti the default value.
All checks were successful
The build was successful.

This commit is contained in:
Rafal Kupiec 2019-03-29 23:51:20 +01:00
parent 9b741175f2
commit 4f6be2234e
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -363,7 +363,9 @@ static ph7_real MemObjCharValue(ph7_value *pObj) {
* Checks a ph7_value variable compatibility with nType data type.
*/
PH7_PRIVATE sxi32 PH7_CheckVarCompat(ph7_value *pObj, int nType) {
if(((nType & MEMOBJ_HASHMAP) == 0) && ((pObj->iFlags & MEMOBJ_HASHMAP) == 0)) {
if(pObj->iFlags & MEMOBJ_NULL) {
return SXRET_OK;
} else if(((nType & MEMOBJ_HASHMAP) == 0) && ((pObj->iFlags & MEMOBJ_HASHMAP) == 0)) {
if((nType & MEMOBJ_REAL) && (pObj->iFlags & MEMOBJ_INT)) {
return SXRET_OK;
} else if((nType & MEMOBJ_CHAR) && (pObj->iFlags & MEMOBJ_INT)) {