| ... | ... | @@ -2835,7 +2835,7 @@ fn genBodyInner(f: *Function, body: []const Air.Inst.Index) error{ AnalysisFail, |
| 2835 | 2835 | |
| 2836 | 2836 | .arg => try airArg(f, inst), |
| 2837 | 2837 | |
| 2838 | | .trap => try airTrap(f.object.writer()), |
| 2838 | .trap => try airTrap(f, f.object.writer()), |
| 2839 | 2839 | .breakpoint => try airBreakpoint(f.object.writer()), |
| 2840 | 2840 | .ret_addr => try airRetAddr(f, inst), |
| 2841 | 2841 | .frame_addr => try airFrameAddress(f, inst), |
| ... | ... | @@ -4591,7 +4591,11 @@ fn bitcast(f: *Function, dest_ty: Type, operand: CValue, operand_ty: Type) !Loca |
| 4591 | 4591 | }; |
| 4592 | 4592 | } |
| 4593 | 4593 | |
| 4594 | | fn airTrap(writer: anytype) !CValue { |
| 4594 | fn airTrap(f: *Function, writer: anytype) !CValue { |
| 4595 | const mod = f.object.dg.module; |
| 4596 | // Not even allowed to call trap in a naked function. |
| 4597 | if (f.object.dg.decl) |decl| if (decl.ty.fnCallingConvention(mod) == .Naked) return .none; |
| 4598 | |
| 4595 | 4599 | try writer.writeAll("zig_trap();\n"); |
| 4596 | 4600 | return .none; |
| 4597 | 4601 | } |