diff --git a/compiler/noirc_evaluator/src/ssa/ir/dfg.rs b/compiler/noirc_evaluator/src/ssa/ir/dfg.rs index aa517d43104..adf0bc23b98 100644 --- a/compiler/noirc_evaluator/src/ssa/ir/dfg.rs +++ b/compiler/noirc_evaluator/src/ssa/ir/dfg.rs @@ -658,7 +658,11 @@ impl DataFlowGraph { pub(crate) fn is_safe_index(&self, index: ValueId, array: ValueId) -> bool { #[allow(clippy::match_like_matches_macro)] match (self.type_of_value(array), self.get_numeric_constant(index)) { - (Type::Array(_, len), Some(index)) if index.to_u128() < (len as u128) => true, + (Type::Array(elements, len), Some(index)) + if index.to_u128() < (len as u128 * elements.len() as u128) => + { + true + } _ => false, } }