Fix NULL comparision
All checks were successful
Build / AerScript (push) Successful in 38s

This commit is contained in:
Rafal Kupiec 2025-08-28 16:42:08 +02:00
parent fdfeb219d9
commit eead19918d
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -1076,6 +1076,15 @@ PH7_PRIVATE sxi32 PH7_MemObjCmp(ph7_value *pObj1, ph7_value *pObj2, int bStrict,
/* Combine flag together */
iComb = pObj1->nType | pObj2->nType;
if(iComb & (MEMOBJ_NULL | MEMOBJ_RES | MEMOBJ_BOOL)) {
/* Explicitly handle NULL/VOID comparisons with numeric types */
if ((pObj1->nType & (MEMOBJ_NULL | MEMOBJ_VOID)) || (pObj2->nType & (MEMOBJ_NULL | MEMOBJ_VOID))) {
/* Convert both operands to their numeric representation
* NULL/VOID will be converted to 0 by PH7_MemObjToNumeric */
PH7_MemObjToNumeric(pObj1);
PH7_MemObjToNumeric(pObj2);
/* Jump to the numeric comparison section */
goto Numeric;
}
/* Convert to boolean: Keep in mind FALSE < TRUE */
if((pObj1->nType & MEMOBJ_BOOL) == 0) {
PH7_MemObjToBool(pObj1);