Sema: check runtime safety is enabled when unwrapping error

This commit is contained in:
ypsvlq 2023-06-13 08:28:06 +01:00 committed by GitHub
parent 529ef75101
commit 387f9568ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11912,11 +11912,11 @@ fn maybeErrorUnwrap(sema: *Sema, block: *Block, body: []const Zir.Inst.Index, op
const tags = sema.code.instructions.items(.tag);
for (body) |inst| {
switch (tags[inst]) {
.@"unreachable" => if (!block.wantSafety()) return false,
.save_err_ret_index,
.dbg_block_begin,
.dbg_block_end,
.dbg_stmt,
.@"unreachable",
.str,
.as_node,
.panic,