| ... | @@ -844,19 +844,19 @@ const WasiThreadImpl = struct { | ... | @@ -844,19 +844,19 @@ const WasiThreadImpl = struct { |
| 844 | const bad_fn_ret = "expected return type of startFn to be 'u8', 'noreturn', 'void', or '!void'"; | 844 | const bad_fn_ret = "expected return type of startFn to be 'u8', 'noreturn', 'void', or '!void'"; |
| 845 | switch (@typeInfo(@typeInfo(@TypeOf(f)).Fn.return_type.?)) { | 845 | switch (@typeInfo(@typeInfo(@TypeOf(f)).Fn.return_type.?)) { |
| 846 | .NoReturn, .Void => { | 846 | .NoReturn, .Void => { |
| 847 | @call(.auto, w, args); | 847 | @call(.auto, f, w.args); |
| 848 | }, | 848 | }, |
| 849 | .Int => |info| { | 849 | .Int => |info| { |
| 850 | if (info.bits != 8) { | 850 | if (info.bits != 8) { |
| 851 | @compileError(bad_fn_ret); | 851 | @compileError(bad_fn_ret); |
| 852 | } | 852 | } |
| 853 | _ = @call(.auto, w, args); // WASI threads don't support exit status, ignore value | 853 | _ = @call(.auto, f, w.args); // WASI threads don't support exit status, ignore value |
| 854 | }, | 854 | }, |
| 855 | .ErrorUnion => |info| { | 855 | .ErrorUnion => |info| { |
| 856 | if (info.payload != void) { | 856 | if (info.payload != void) { |
| 857 | @compileError(bad_fn_ret); | 857 | @compileError(bad_fn_ret); |
| 858 | } | 858 | } |
| 859 | @call(.auto, f, args) catch |err| { | 859 | @call(.auto, f, w.args) catch |err| { |
| 860 | std.debug.print("error: {s}\n", .{@errorName(err)}); | 860 | std.debug.print("error: {s}\n", .{@errorName(err)}); |
| 861 | if (@errorReturnTrace()) |trace| { | 861 | if (@errorReturnTrace()) |trace| { |
| 862 | std.debug.dumpStackTrace(trace.*); | 862 | std.debug.dumpStackTrace(trace.*); |