From 387f9568ad0dabd426d382efb45b9c52a4ccc5bb Mon Sep 17 00:00:00 2001 From: ypsvlq <86775241+ypsvlq@users.noreply.github.com> Date: Tue, 13 Jun 2023 08:28:06 +0100 Subject: [PATCH] Sema: check runtime safety is enabled when unwrapping error --- src/Sema.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sema.zig b/src/Sema.zig index aa04c40fd0..cb69fa92d8 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -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,