| ... | @@ -1006,11 +1006,15 @@ fn airLoad(o: *Object, inst: Air.Inst.Index) !CValue { | ... | @@ -1006,11 +1006,15 @@ fn airLoad(o: *Object, inst: Air.Inst.Index) !CValue { |
| 1006 | | 1006 | |
| 1007 | fn airRet(o: *Object, inst: Air.Inst.Index) !CValue { | 1007 | fn airRet(o: *Object, inst: Air.Inst.Index) !CValue { |
| 1008 | const un_op = o.air.instructions.items(.data)[inst].un_op; | 1008 | const un_op = o.air.instructions.items(.data)[inst].un_op; |
| 1009 | const operand = try o.resolveInst(un_op); | | |
| 1010 | const writer = o.writer(); | 1009 | const writer = o.writer(); |
| 1011 | try writer.writeAll("return "); | 1010 | if (o.air.typeOf(un_op).hasCodeGenBits()) { |
| 1012 | try o.writeCValue(writer, operand); | 1011 | const operand = try o.resolveInst(un_op); |
| 1013 | try writer.writeAll(";\n"); | 1012 | try writer.writeAll("return "); |
| | 1013 | try o.writeCValue(writer, operand); |
| | 1014 | try writer.writeAll(";\n"); |
| | 1015 | } else { |
| | 1016 | try writer.writeAll("return;\n"); |
| | 1017 | } |
| 1014 | return CValue.none; | 1018 | return CValue.none; |
| 1015 | } | 1019 | } |
| 1016 | | 1020 | |