diff options
Diffstat (limited to 'src/codegen/c.zig')
| -rw-r--r-- | src/codegen/c.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig index 16828ecb82..c00b0247bb 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -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` |
