Skip to content
5 changes: 2 additions & 3 deletions compiler/noirc_evaluator/src/ssa/ir/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,16 +460,15 @@ impl Instruction {
BinaryOp::Div | BinaryOp::Mod => {
dfg.get_numeric_constant(binary.rhs).is_none_or(|c| c.is_zero())
}
BinaryOp::Shl | BinaryOp::Shr => true,
BinaryOp::Add { unchecked: true }
| BinaryOp::Sub { unchecked: true }
| BinaryOp::Mul { unchecked: true }
| BinaryOp::Eq
| BinaryOp::Lt
| BinaryOp::And
| BinaryOp::Or
| BinaryOp::Xor
| BinaryOp::Shl
| BinaryOp::Shr => false,
| BinaryOp::Xor => false,
},

// These don't have side effects
Expand Down
6 changes: 6 additions & 0 deletions test_programs/execution_success/regression_9544/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "regression_9544"
type = "bin"
authors = [""]

[dependencies]
2 changes: 2 additions & 0 deletions test_programs/execution_success/regression_9544/Prover.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
c = 8483479640938442498
return = 5
15 changes: 15 additions & 0 deletions test_programs/execution_success/regression_9544/src/main.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
fn main(c: u64) -> pub u64 {
if c == 1 {
if c == 2 {
c >> c
} else {
3
}
} else {
if c == 4 {
c >> c
} else {
5
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading