Skip to content

Commit

Permalink
move position scratch variables into local scope for interpreter vari…
Browse files Browse the repository at this point in the history
…able
  • Loading branch information
svv232 committed Dec 17, 2024
1 parent c1b350e commit 75bc47d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions o1vm/src/interpreters/riscv32im/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2212,10 +2212,11 @@ pub fn interpret_utype<Env: InterpreterEnv>(env: &mut Env, instr: UInstruction)
env.sign_extend(&shifted_imm, 32)
};
let local_pc = instruction_pointer.clone();
let pos = env.alloc_scratch();
let overflow_pos = env.alloc_scratch();
let (local_rd, _) =
unsafe { env.add_witness(&local_pc, &local_imm, pos, overflow_pos) };
let (local_rd, _) = {
let pos = env.alloc_scratch();
let overflow_pos = env.alloc_scratch();
unsafe { env.add_witness(&local_pc, &local_imm, pos, overflow_pos) }
};
env.write_register(&rd, local_rd);

env.set_instruction_pointer(next_instruction_pointer.clone());
Expand Down

0 comments on commit 75bc47d

Please sign in to comment.