zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 52b8efc726097df70dca7287b0a8e16b0a8a642d (tree)
parent 40a2dfc12a611082ba6810c566a6a46acdb864fc
Author: Veikka Tuominen <git@vexu.eu>
Date:   Wed,  9 Nov 2022 20:09:06 +0200

Sema: check for error unwrap in `condbr_inline`

The part of `condbr` that is supposed to be the same as `condbr_inline`
already does this.

Diffstat:
Msrc/Sema.zig | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/Sema.zig b/src/Sema.zig @@ -1491,6 +1491,8 @@ fn analyzeBodyInner( return err; }; const inline_body = if (cond.val.toBool()) then_body else else_body; + + try sema.maybeErrorUnwrapCondbr(block, inline_body, extra.data.condition, cond_src); const old_runtime_index = block.runtime_index; defer block.runtime_index = old_runtime_index; const break_data = (try sema.analyzeBodyBreak(block, inline_body)) orelse