From 9e53be159b897f0ea198208f945d35ed7e79488d Mon Sep 17 00:00:00 2001 From: Tom French Date: Mon, 28 Oct 2024 17:12:17 +0000 Subject: [PATCH] feat: do not increment reference counts on arrays through references --- compiler/noirc_evaluator/src/ssa/function_builder/mod.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/compiler/noirc_evaluator/src/ssa/function_builder/mod.rs b/compiler/noirc_evaluator/src/ssa/function_builder/mod.rs index f810b65d105..aebb47ccf8e 100644 --- a/compiler/noirc_evaluator/src/ssa/function_builder/mod.rs +++ b/compiler/noirc_evaluator/src/ssa/function_builder/mod.rs @@ -442,13 +442,7 @@ impl FunctionBuilder { match self.type_of_value(value) { Type::Numeric(_) => (), Type::Function => (), - Type::Reference(element) => { - if element.contains_an_array() { - let reference = value; - let value = self.insert_load(reference, element.as_ref().clone()); - self.update_array_reference_count(value, increment); - } - } + Type::Reference(_) => (), Type::Array(..) | Type::Slice(..) => { // If there are nested arrays or slices, we wait until ArrayGet // is issued to increment the count of that array.