Merge pull request #73896 from vnen/object-null-boolean-consistency

Make freed object different than null in comparison operators
This commit is contained in:
Yuri Sizov 2023-12-16 17:49:05 +01:00
commit ca19d34bde
2 changed files with 17 additions and 17 deletions

View file

@ -931,7 +931,7 @@ bool Variant::is_zero() const {
return *reinterpret_cast<const ::RID *>(_data._mem) == ::RID();
}
case OBJECT: {
return _get_obj().obj == nullptr;
return get_validated_object() == nullptr;
}
case CALLABLE: {
return reinterpret_cast<const Callable *>(_data._mem)->is_null();