mirror of
https://github.com/ziglang/zig.git
synced 2026-02-05 22:16:58 +00:00
fix unwrap error payload not emitting debug safety
This commit is contained in:
parent
a665872e88
commit
cd992b89d2
@ -12423,6 +12423,7 @@ bool ir_has_side_effects(IrInstruction *instruction) {
|
||||
case IrInstructionIdCheckSwitchProngs:
|
||||
case IrInstructionIdSetGlobalAlign:
|
||||
case IrInstructionIdSetGlobalSection:
|
||||
case IrInstructionIdUnwrapErrPayload:
|
||||
return true;
|
||||
case IrInstructionIdPhi:
|
||||
case IrInstructionIdUnOp:
|
||||
@ -12471,7 +12472,6 @@ bool ir_has_side_effects(IrInstruction *instruction) {
|
||||
case IrInstructionIdFrameAddress:
|
||||
case IrInstructionIdTestErr:
|
||||
case IrInstructionIdUnwrapErrCode:
|
||||
case IrInstructionIdUnwrapErrPayload:
|
||||
case IrInstructionIdMaybeWrap:
|
||||
case IrInstructionIdErrWrapCode:
|
||||
case IrInstructionIdErrWrapPayload:
|
||||
|
||||
@ -1896,6 +1896,20 @@ fn unsigned_cast(x: i32) -> u32 {
|
||||
}
|
||||
)SOURCE");
|
||||
|
||||
add_debug_safety_case("unwrap error", R"SOURCE(
|
||||
pub fn panic(message: []const u8) -> unreachable {
|
||||
@breakpoint();
|
||||
while (true) {}
|
||||
}
|
||||
error Whatever;
|
||||
pub fn main(args: [][]u8) -> %void {
|
||||
%%bar();
|
||||
}
|
||||
fn bar() -> %void {
|
||||
return error.Whatever;
|
||||
}
|
||||
)SOURCE");
|
||||
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user