diff --git a/extensions/native/recursion/src/stark/mod.rs b/extensions/native/recursion/src/stark/mod.rs index ab0e8e7fd..60145477e 100644 --- a/extensions/native/recursion/src/stark/mod.rs +++ b/extensions/native/recursion/src/stark/mod.rs @@ -215,19 +215,26 @@ where }); */ + let end = builder + .get_ref(main_trace_commits, main_trace_commits.len()) + .ptr + .address; builder .range_with_step( main_trace_commits.ptr().address, - builder - .get_ptr(main_trace_commits, main_trace_commits.len() - 1) - .address, + end, DigestVariable::::size_of(), ) .for_each(|address, builder| { - let main_commit = builder.uninit(); + let main_commit: DigestVariable = builder.uninit(); builder.load( - main_commit, - Ptr { address }, + main_commit.clone(), + Ptr { + address: match address { + RVar::Const(c) => unreachable!(), + RVar::Val(v) => v, + }, + }, MemIndex { index: RVar::zero(), offset: 0,