| author | |
| committer | |
| log | dc214e041eda1461cc2317523e1656c5a0f55c1a |
| tree | 335b405606e20b7412e5a0b26fb02b923451c220 |
| parent | 6f85a67987e187b8fdc29570d229bf5ad4f6a947 |
Investigating hexops/zorex#4, I found that `--test-evented-io` is currently broken in
the latest Zig nightly. See #9779 for a small reproduction.
The issue is that allocation errors here are not correctly handled, as this function
returns `void` and all other error cases `@panic`, the allocation failure should also
use `@panic`.
Fixes #9779
Helps hexops/zorex#4
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>1 files changed, 1 insertions(+), 1 deletions(-)
lib/std/special/test_runner.zig+1-1| ... | ... | @@ -56,7 +56,7 @@ pub fn main() void { |
| 56 | 56 | .evented => blk: { |
| 57 | 57 | if (async_frame_buffer.len < size) { |
| 58 | 58 | std.heap.page_allocator.free(async_frame_buffer); |
| 59 | async_frame_buffer = try std.heap.page_allocator.alignedAlloc(u8, std.Target.stack_align, size); | |
| 59 | async_frame_buffer = std.heap.page_allocator.alignedAlloc(u8, std.Target.stack_align, size) catch @panic("out of memory"); | |
| 60 | 60 | } |
| 61 | 61 | const casted_fn = @ptrCast(fn () callconv(.Async) anyerror!void, test_fn.func); |
| 62 | 62 | break :blk await @asyncCall(async_frame_buffer, {}, casted_fn, .{}); |