zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 889bed13c34a241a8767e9e737c2bc18a09826e1 (tree)
parent cd992b89d2252fade1e56b5e4e7537b171af890e
Author: Andrew Kelley <superjoe30@gmail.com>
Date:   Fri, 24 Feb 2017 15:11:33 -0500

unwrap error payload instruction has side effects only if safety check on

Diffstat:
Msrc/ir.cpp | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/ir.cpp b/src/ir.cpp @@ -12423,7 +12423,6 @@ bool ir_has_side_effects(IrInstruction *instruction) { case IrInstructionIdCheckSwitchProngs: case IrInstructionIdSetGlobalAlign: case IrInstructionIdSetGlobalSection: - case IrInstructionIdUnwrapErrPayload: return true; case IrInstructionIdPhi: case IrInstructionIdUnOp: @@ -12492,6 +12491,12 @@ bool ir_has_side_effects(IrInstruction *instruction) { IrInstructionAsm *asm_instruction = (IrInstructionAsm *)instruction; return asm_instruction->has_side_effects; } + case IrInstructionIdUnwrapErrPayload: + { + IrInstructionUnwrapErrPayload *unwrap_err_payload_instruction = + (IrInstructionUnwrapErrPayload *)instruction; + return unwrap_err_payload_instruction->safety_check_on; + } } zig_unreachable(); }