| author | |
| committer | |
| log | 923ddd94a1419abfa9ab95718a7b7d2a8da7a5ec |
| tree | 588fd75889acd8f37b9da3bc7745561122ffdd68 |
| parent | 2e31077fe0e021858cf2f92f85e5fcfd12c41501 |
| signature |
This is to help diagnose #25498. We can't use `unexpectedErrno` here,
because `std.posix.munmap` is infallible. So, when the flag is set to
report unexpected errnos, we just call `std.debug.panic` to provide
details instead of doing `unreachable`.
Pushing straight to master after running checks locally; there's no
point waiting for CI on the PR just for this.1 files changed, 3 insertions(+), 1 deletions(-)
lib/std/posix.zig+3-1| ... | ... | @@ -4991,7 +4991,9 @@ pub fn munmap(memory: []align(page_size_min) const u8) void { |
| 4991 | 4991 | .SUCCESS => return, |
| 4992 | 4992 | .INVAL => unreachable, // Invalid parameters. |
| 4993 | 4993 | .NOMEM => unreachable, // Attempted to unmap a region in the middle of an existing mapping. |
| 4994 | else => unreachable, | |
| 4994 | else => |e| if (unexpected_error_tracing) { | |
| 4995 | std.debug.panic("unexpected errno: {d} ({t})", .{ @intFromEnum(e), e }); | |
| 4996 | } else unreachable, | |
| 4995 | 4997 | } |
| 4996 | 4998 | } |
| 4997 | 4999 |