mirror of
https://github.com/ziglang/zig.git
synced 2025-12-28 17:13:19 +00:00
parent
0b1dd845d9
commit
cc89908e82
@ -26897,10 +26897,14 @@ fn analyzeIsNull(
|
||||
}
|
||||
}
|
||||
|
||||
const inverted_non_null_res = if (invert_logic) Air.Inst.Ref.bool_true else Air.Inst.Ref.bool_false;
|
||||
const operand_ty = sema.typeOf(operand);
|
||||
var buf: Type.Payload.ElemType = undefined;
|
||||
if (operand_ty.zigTypeTag() == .Optional and operand_ty.optionalChild(&buf).zigTypeTag() == .NoReturn) {
|
||||
return Air.Inst.Ref.bool_true;
|
||||
return inverted_non_null_res;
|
||||
}
|
||||
if (operand_ty.zigTypeTag() != .Optional and !operand_ty.isPtrLikeOptional()) {
|
||||
return inverted_non_null_res;
|
||||
}
|
||||
try sema.requireRuntimeBlock(block, src, null);
|
||||
const air_tag: Air.Inst.Tag = if (invert_logic) .is_non_null else .is_null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user