diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-05-22 21:51:44 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-05-24 15:34:52 -0700 |
| commit | 3264abe3d8f658e1b7275d2be80e43eddfc098dc (patch) | |
| tree | c4cb6d837e163fb19da5591e4cea90684b52e316 /lib/std | |
| parent | 60f0acd9b9c2bced47ba1c214460f34b73738f95 (diff) | |
| download | zig-3264abe3d8f658e1b7275d2be80e43eddfc098dc.tar.gz zig-3264abe3d8f658e1b7275d2be80e43eddfc098dc.zip | |
stage2: fixes for error union semantics
* Sema: avoid unnecessary safety checks when an error set is empty.
* Sema: make zirErrorToInt handle comptime errors that are represented
as integers.
* Sema: make empty error sets properly integrate with
typeHasOnePossibleValue.
* Type: correct the ABI alignment and size of error unions which have
both zero-bit error set and zero-bit payload. The previous code did
not account for the fact that we still need to store a bit for
whether there is an error.
* LLVM: lower error unions possibly with the payload first or with the
error code first, depending on alignment. Previously it always put
the error code first and used a padding array.
* LLVM: lower functions which have an empty error set as the return
type the same as anyerror, so that they can be used where
fn()anyerror function pointers are expected. In such functions, Zig
will lower ret to returning zero instead of void.
As a result, one more behavior test is passing.
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/debug.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 83667c758b..86ed1c5a65 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -1798,7 +1798,7 @@ fn resetSegfaultHandler() void { .mask = os.empty_sigset, .flags = 0, }; - // do nothing if an error happens to avoid a double-panic + // To avoid a double-panic, do nothing if an error happens here. updateSegfaultHandler(&act) catch {}; } |
