implement Crash

This commit is contained in:
Folkert 2023-04-27 00:29:21 +02:00
parent f95c79bb53
commit c6c28e7c5d
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 37 additions and 10 deletions

View file

@ -107,15 +107,16 @@ pub fn memcpy(dst: [*]u8, src: [*]u8, size: usize) void {
// indirection because otherwise zig creates an alias to the panic function which our LLVM code
// does not know how to deal with
pub fn test_panic(c_ptr: *anyopaque, alignment: u32) callconv(.C) void {
pub fn test_panic(c_ptr: *anyopaque, crash_tag: u32) callconv(.C) void {
_ = c_ptr;
_ = alignment;
// const cstr = @ptrCast([*:0]u8, c_ptr);
_ = crash_tag;
// const stderr = std.io.getStdErr().writer();
// stderr.print("Roc panicked: {s}!\n", .{cstr}) catch unreachable;
// std.c.exit(1);
// const cstr = @ptrCast([*:0]u8, c_ptr);
//
// const stderr = std.io.getStdErr().writer();
// stderr.print("Roc panicked: {s}!\n", .{cstr}) catch unreachable;
//
// std.c.exit(1);
}
pub const Inc = fn (?[*]u8) callconv(.C) void;