Permanently fix NULL comparision
Some checks failed
Build / AerScript (push) Failing after 26s

This commit is contained in:
Rafal Kupiec 2025-08-29 14:27:58 +02:00
parent dc5725d1af
commit a167e4bc87
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -1077,11 +1077,16 @@ PH7_PRIVATE sxi32 PH7_MemObjCmp(ph7_value *pObj1, ph7_value *pObj2, int bStrict,
iComb = pObj1->nType | pObj2->nType; iComb = pObj1->nType | pObj2->nType;
if(iComb & (MEMOBJ_NULL | MEMOBJ_RES | MEMOBJ_BOOL)) { if(iComb & (MEMOBJ_NULL | MEMOBJ_RES | MEMOBJ_BOOL)) {
/* Explicitly handle NULL/VOID comparisons with numeric types */ /* Explicitly handle NULL/VOID comparisons with numeric types */
if ((pObj1->nType & (MEMOBJ_NULL | MEMOBJ_VOID)) || (pObj2->nType & (MEMOBJ_NULL | MEMOBJ_VOID))) { if(pObj1->nType & (MEMOBJ_NULL | MEMOBJ_VOID))
/* Convert both operands to their numeric representation {
* NULL/VOID will be converted to 0 by PH7_MemObjToNumeric */ /* Convert NULL/VOID to numeric */
PH7_MemObjToNumeric(pObj1); PH7_MemObjToNumeric(pObj1);
}
if(pObj2->nType & (MEMOBJ_NULL | MEMOBJ_VOID)) {
/* Convert NULL/VOID to numeric */
PH7_MemObjToNumeric(pObj2); PH7_MemObjToNumeric(pObj2);
}
if(PH7_MemObjIsNumeric(pObj1) && PH7_MemObjIsNumeric(pObj2)) {
/* Jump to the numeric comparison section */ /* Jump to the numeric comparison section */
goto Numeric; goto Numeric;
} }