| author | |
| committer | |
| log | 7a85ad151daece3d0bba3c8d23081502a0956c95 |
| tree | 4f11b16bdf5c0ae231df3b5463b32074389797b5 |
| parent | 51f6438e076c0347197c251716174037a8465e91 |
This logic already existed for the void type, but is also necessary for
other 0-bit types. Without it, we try to alloc a local for a 0-bit type
which gets translated to a local of type `void` which C doesn't like.1 files changed, 1 insertions(+), 1 deletions(-)
src/codegen/c.zig+1-1| ... | ... | @@ -4285,7 +4285,7 @@ fn airBlock(f: *Function, inst: Air.Inst.Index) !CValue { |
| 4285 | 4285 | const writer = f.object.writer(); |
| 4286 | 4286 | |
| 4287 | 4287 | const inst_ty = f.typeOfIndex(inst); |
| 4288 | const result = if (inst_ty.ip_index != .void_type and !f.liveness.isUnused(inst)) | |
| 4288 | const result = if (inst_ty.hasRuntimeBitsIgnoreComptime(mod) and !f.liveness.isUnused(inst)) | |
| 4289 | 4289 | try f.allocLocal(inst, inst_ty) |
| 4290 | 4290 | else |
| 4291 | 4291 | .none; |