~sircmpwn/helios

a10eb834a4bf7faeaa77669c79f5863e53b3593e — Bor Grošelj Simić 4 months ago 52a95e5
rt: update abort for harec non-constant assert changes
1 files changed, 5 insertions(+), 7 deletions(-)

M rt/abort.ha
M rt/abort.ha => rt/abort.ha +5 -7
@@ 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]);
};