From b1885c9308dcb719b3795cfb09f82bb9731872ac Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 18 Feb 2025 21:08:25 +0100 Subject: [PATCH] Fix opioid. (#2499) --- executor/src/witgen/jit/function_cache.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/executor/src/witgen/jit/function_cache.rs b/executor/src/witgen/jit/function_cache.rs index 150fc272d9..ea35df324a 100644 --- a/executor/src/witgen/jit/function_cache.rs +++ b/executor/src/witgen/jit/function_cache.rs @@ -207,15 +207,19 @@ impl<'a, T: FieldElement> FunctionCache<'a, T> { let cache_key = CacheKey { identity_id: connection_id, - known_args, + known_args: known_args.clone(), known_concrete, }; - // TODO If the function is not in the cache, we should also try with - // known_concrete set to None. - self.witgen_functions .get(&cache_key) + .or_else(|| { + self.witgen_functions.get(&CacheKey { + identity_id: connection_id, + known_args: known_args.clone(), + known_concrete: None, + }) + }) .expect("Need to call compile_cached() first!") .as_ref() .expect("compile_cached() returned false!")