Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,9 @@ fn responds_to_side_effects_var(dfg: &DataFlowGraph, instruction: &Instruction)
dfg.type_of_value(binary.lhs).is_unsigned()
}
BinaryOp::Div | BinaryOp::Mod => {
if let Some(rhs) = dfg.get_numeric_constant(binary.rhs) {
rhs == FieldElement::zero()
} else {
true
}
// Even with non zero rhs, division and modulo respond to side effects because they
// use non-deterministic outputs which will be affected by the side effects var.
true
}
_ => false,
},
Expand Down
6 changes: 6 additions & 0 deletions test_programs/execution_success/regression_8261/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "regression_8261"
type = "bin"
authors = [""]

[dependencies]
29 changes: 29 additions & 0 deletions test_programs/execution_success/regression_8261/Prover.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
a = true
b = [
[
true,
false,
],
[
true,
true,
],
"\u0014w",
[
"0x000000000000000000000000000000000000000000000000000000000000dd8e",
"0x00000000000000000000000000000000000000000000000000000000000002cc",
],
"0x000000000000000000000000000000000000000000000000000000000000137c",
]
c = [
[
"0x1eac91250e5e424f9c8b3eb451e0b343131fcf4342053cfad6337e7ca1350adb",
"",
false,
false,
],
[
"0x000000000000000000000000000000000000000000000000000000000000c456",
"\u001B\"",
],
]
16 changes: 16 additions & 0 deletions test_programs/execution_success/regression_8261/src/main.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
fn main(
a: bool,
b: ([bool; 2], [bool; 2], str<2>, (u16, u16), u16),
c: ((Field, str<0>, bool, bool), (u16, str<2>)),
) -> pub u16 {
b.4
% if c.0.2 {
b.3.0
} else {
if (!a) {
37995
} else {
(b.3.1 % 64485)
}
}
}
1 change: 1 addition & 0 deletions test_programs/execution_success/regression_8261/stdout.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[regression_8261] Circuit output: Field(692)

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