-
-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update zig @panic
calls to roc_panic
for numeric errors
#6062
Changes from 16 commits
737d766
23e2269
191752e
5df2199
863ecd8
abc92de
14478c8
c9e1456
925cba4
38207cf
4fe4041
2a762f1
a5180be
d6f0709
d37dd44
298f93d
20bcd70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,14 @@ const std = @import("std"); | |
const RocStr = @import("str.zig").RocStr; | ||
|
||
// Signals to the host that the program has panicked | ||
extern fn roc_panic(msg: *const RocStr, tag_id: u32) callconv(.C) void; | ||
extern fn roc_panic(msg: *const RocStr, tag_id: u32) callconv(.C) noreturn; | ||
|
||
pub fn panic_help(msg: []const u8, tag_id: u32) void { | ||
pub fn panic_help(msg: []const u8, tag_id: u32) noreturn { | ||
var str = RocStr.init(msg.ptr, msg.len); | ||
roc_panic(&str, tag_id); | ||
} | ||
|
||
// must export this explicitly because right now it is not used from zig code | ||
pub fn panic(msg: *const RocStr, alignment: u32) callconv(.C) void { | ||
pub fn panic(msg: *const RocStr, alignment: u32) callconv(.C) noreturn { | ||
return roc_panic(msg, alignment); | ||
} | ||
Comment on lines
+5
to
15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was having a weird error in CI were valgrind was crashing but was not happening locally My gut feeling is that us adding Looks like unreachable is undefined behavior when compiled with RelaseFast https://ziglang.org/documentation/master/#try which i think we do This return type lets you do
without zig type errors There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So glad this worked. Thanks for the find |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
#!/usr/bin/bash | ||
|
||
SCRIPT_DIR=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd) | ||
${SCRIPT_DIR}/../../target/debug/roc_ls "$@" 2> /tmp/roc_ls.err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.