From ffdd2d2cd3a69aae6981c7ff65597ca7998da9f9 Mon Sep 17 00:00:00 2001 From: Tim Hoffman Date: Mon, 12 Aug 2024 14:39:16 -0500 Subject: [PATCH] [VAN-655] remove unsafe usage --- circuit_passes/src/bucket_interpreter/mod.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/circuit_passes/src/bucket_interpreter/mod.rs b/circuit_passes/src/bucket_interpreter/mod.rs index 90427333..404ae6b6 100644 --- a/circuit_passes/src/bucket_interpreter/mod.rs +++ b/circuit_passes/src/bucket_interpreter/mod.rs @@ -754,12 +754,8 @@ impl BucketInterpreter<'_, '_> { self.flags.clone(), ); let observe = observe && !interp.observer.ignore_extracted_function_calls(); - unsafe { - let ptr = instructions.as_ptr(); - for i in 0..instructions.len() { - let inst = ptr.add(i).as_ref().unwrap(); - res = Result::from(interp._execute_instruction(inst, res.1, observe))?; - } + for inst in instructions { + res = Result::from(interp._execute_instruction(&inst, res.1, observe))?; } // ASSERT: All generated functions have void return type, thus produce no value(s) assert!(res.0.is_empty());