mirror of
https://github.com/ziglang/zig.git
synced 2026-02-20 16:24:51 +00:00
c codegen: fix airIsNull with pointers
This commit is contained in:
parent
19e5663869
commit
08d6876d20
@ -2165,7 +2165,10 @@ fn airIsNull(
|
||||
|
||||
const ty = f.air.typeOf(un_op);
|
||||
var opt_buf: Type.Payload.ElemType = undefined;
|
||||
const payload_type = ty.optionalChild(&opt_buf);
|
||||
const payload_type = if (ty.zigTypeTag() == .Pointer)
|
||||
ty.childType().optionalChild(&opt_buf)
|
||||
else
|
||||
ty.optionalChild(&opt_buf);
|
||||
|
||||
if (ty.isPtrLikeOptional()) {
|
||||
// operand is a regular pointer, test `operand !=/== NULL`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user