Fix crash on array compare containing absent values (#2039)

This commit is contained in:
Balki 2026-04-17 13:50:34 +00:00 committed by GitHub
parent 917af379a5
commit 549864bf38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -243,6 +243,10 @@ func eq_b_aa(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval {
// Same-length arrays: return false if any slot is not equal, else true.
for i := range a {
eq := BIF_equals(a[i], b[i])
// Treat invalid comparison as false
if eq.Type() == mlrval.MT_ABSENT {
return mlrval.FALSE
}
lib.InternalCodingErrorIf(eq.Type() != mlrval.MT_BOOL)
if !eq.AcquireBoolValue() {
return mlrval.FALSE