Skip to content

Instantly share code, notes, and snippets.

@jamii

jamii/main.zig Secret

Last active May 15, 2021 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamii/fb39e1d2f07f26642b63fbe127033812 to your computer and use it in GitHub Desktop.
Save jamii/fb39e1d2f07f26642b63fbe127033812 to your computer and use it in GitHub Desktop.
[nix-shell:~/bounded-live-eval]$ zig run main.zig
thread 7417 panic: awaiting function resumed
/home/jamie/bounded-live-eval/main.zig:6:6: 0x22ffe3 in b (main)
a();
^
/home/jamie/bounded-live-eval/main.zig:14:5: 0x22920f in main (main)
resume b_frame;
^
/nix/store/7wdppz5pss576bn60rl053ihwx7v635i-zig/lib/std/start.zig:410:22: 0x221bec in std.start.callMain (main)
root.main();
^
/nix/store/7wdppz5pss576bn60rl053ihwx7v635i-zig/lib/std/start.zig:362:12: 0x205b3e in std.start.callMainWithArgs (main)
return @call(.{ .modifier = .always_inline }, callMain, .{});
^
/nix/store/7wdppz5pss576bn60rl053ihwx7v635i-zig/lib/std/start.zig:316:17: 0x204dc9 in std.start.posixCallMainAndExit (main)
std.os.exit(@call(.{ .modifier = .always_inline }, callMainWithArgs, .{ argc, argv, envp }));
^
/nix/store/7wdppz5pss576bn60rl053ihwx7v635i-zig/lib/std/start.zig:238:5: 0x204cf2 in std.start._start (main)
@call(.{ .modifier = .never_inline }, posixCallMainAndExit, .{});
^
Aborted (core dumped)
fn a() void {
suspend {}
}
fn b() void {
a();
}
pub fn main() void {
// this works fine
var a_frame = async a();
resume a_frame;
// this panics
var b_frame = async b();
resume b_frame;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment