@@ 16,8 16,10 @@ fn abort_writestr(s: str) size = {
return writer(buf);
};
-export @symbol("rt.abort") fn _abort(msg: str) void = {
+export @symbol("rt.abort") fn _abort(loc: str, msg: str) void = {
abort_writestr("Abort: ");
+ abort_writestr(loc);
+ abort_writestr(": ");
abort_writestr(msg);
abort_writestr("\n");
halt();
@@ 30,13 32,9 @@ const reasons: [_]str = [
"out of memory", // 2
"static insert/append exceeds slice capacity", // 3
"execution reached unreachable code (compiler bug)", // 4
+ "assertion failed", // 5
];
export @noreturn fn abort_fixed(loc: str, i: int) void = {
- abort_writestr("Abort: ");
- abort_writestr(loc);
- abort_writestr(": ");
- abort_writestr(reasons[i]);
- abort_writestr("\n");
- halt();
+ _abort(loc, reasons[i]);
};