From 3d4d070292ba3973cd9e24c86478cfe76628d3e4 Mon Sep 17 00:00:00 2001 From: Tom French Date: Wed, 17 Jan 2024 22:36:30 +0000 Subject: [PATCH] fix: hoist constraints on inputs to top of program --- compiler/noirc_evaluator/src/ssa/opt/bubble_up_constrains.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/noirc_evaluator/src/ssa/opt/bubble_up_constrains.rs b/compiler/noirc_evaluator/src/ssa/opt/bubble_up_constrains.rs index e0144005a0f..cb9519eeb2e 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/bubble_up_constrains.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/bubble_up_constrains.rs @@ -30,7 +30,7 @@ impl Ssa { // We iterate through the previous instructions in reverse order so the index is from the // back of the vector. Subtract from vector length to get correct index. .map(|reversed_index| filtered_instructions.len() - reversed_index) - .unwrap_or(filtered_instructions.len()); + .unwrap_or(0); filtered_instructions.insert(index, instruction); }