| author | |
| committer | |
| log | 27d4bf753467894836e960bced73740c95e61db8 |
| tree | 27e6467784cb9cff21ed81c7209a92b38aa7699e |
| parent | b0dba4680012e47ffc99f87bab4b53a976cb8b8e |
| signature |
2 files changed, 31 insertions(+), 0 deletions(-)
src/Sema.zig+1| ... | ... | @@ -11806,6 +11806,7 @@ fn zirSwitchBlock(sema: *Sema, block: *Block, inst: Zir.Inst.Index, operand_is_r |
| 11806 | 11806 | .runtime_cond = block.runtime_cond, |
| 11807 | 11807 | .runtime_loop = block.runtime_loop, |
| 11808 | 11808 | .runtime_index = block.runtime_index, |
| 11809 | .want_safety = block.want_safety, | |
| 11809 | 11810 | .error_return_trace_index = block.error_return_trace_index, |
| 11810 | 11811 | }; |
| 11811 | 11812 | const merges = &child_block.label.?.merges; |
test/cases/inherit_want_safety.zig created+30| ... | ... | @@ -0,0 +1,30 @@ |
| 1 | pub const panic = @compileError(""); | |
| 2 | ||
| 3 | pub export fn entry() usize { | |
| 4 | @setRuntimeSafety(false); | |
| 5 | var u: usize = 0; | |
| 6 | { | |
| 7 | u += 1; | |
| 8 | } | |
| 9 | if (u == 0) { | |
| 10 | u += 1; | |
| 11 | } | |
| 12 | while (u == 0) { | |
| 13 | u += 1; | |
| 14 | } | |
| 15 | for (0..u) |_| { | |
| 16 | u += 1; | |
| 17 | } | |
| 18 | defer { | |
| 19 | u += 1; | |
| 20 | } | |
| 21 | switch (u) { | |
| 22 | else => { | |
| 23 | u += 1; | |
| 24 | }, | |
| 25 | } | |
| 26 | return u; | |
| 27 | } | |
| 28 | ||
| 29 | // compile | |
| 30 | // output_mode=Obj |