commit 0daa77bd63a3ef9666d5ccda40929403a4bb3305 (tree)
parent f46d7304b176cdc77053225943a7d5030dd0d4ee
Author: Veikka Tuominen <git@vexu.eu>
Date: Fri, 5 Aug 2022 20:53:34 +0300
stage2 cbe: correct `airIsNull` ptr operand check
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
@@ -3252,7 +3252,7 @@ fn airIsNull(
const ty = f.air.typeOf(un_op);
var opt_buf: Type.Payload.ElemType = undefined;
- const payload_ty = if (ty.zigTypeTag() == .Pointer)
+ const payload_ty = if (deref_suffix[0] != 0)
ty.childType().optionalChild(&opt_buf)
else
ty.optionalChild(&opt_buf);