authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-11-09 20:09:06+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-11-11 18:01:14+02:00
log52b8efc726097df70dca7287b0a8e16b0a8a642d
treeda6401405b424123fda197f4f847878399bb6343
parent40a2dfc12a611082ba6810c566a6a46acdb864fc

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.

1 files changed, 2 insertions(+), 0 deletions(-)

src/Sema.zig+2
...@@ -1491,6 +1491,8 @@ fn analyzeBodyInner(...@@ -1491,6 +1491,8 @@ fn analyzeBodyInner(
1491 return err;1491 return err;
1492 };1492 };
1493 const inline_body = if (cond.val.toBool()) then_body else else_body;1493 const inline_body = if (cond.val.toBool()) then_body else else_body;
1494
1495 try sema.maybeErrorUnwrapCondbr(block, inline_body, extra.data.condition, cond_src);
1494 const old_runtime_index = block.runtime_index;1496 const old_runtime_index = block.runtime_index;
1495 defer block.runtime_index = old_runtime_index;1497 defer block.runtime_index = old_runtime_index;
1496 const break_data = (try sema.analyzeBodyBreak(block, inline_body)) orelse1498 const break_data = (try sema.analyzeBodyBreak(block, inline_body)) orelse