From 76ba34a2166694c403c084d35993bf0187ad3f7f Mon Sep 17 00:00:00 2001 From: svv232 Date: Mon, 23 Dec 2024 15:24:23 -0500 Subject: [PATCH] move position of less than variable into local scope --- o1vm/src/interpreters/riscv32im/interpreter.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/o1vm/src/interpreters/riscv32im/interpreter.rs b/o1vm/src/interpreters/riscv32im/interpreter.rs index 3801a63b0d..207a63a3ff 100644 --- a/o1vm/src/interpreters/riscv32im/interpreter.rs +++ b/o1vm/src/interpreters/riscv32im/interpreter.rs @@ -2239,10 +2239,10 @@ pub fn interpret_sbtype(env: &mut Env, instr: SBInstruction let local_rs1 = env.read_register(&rs1); let local_rs2 = env.read_register(&rs2); - let rd_scratch = env.alloc_scratch(); - - let less_than = - unsafe { env.test_less_than_signed(&local_rs1, &local_rs2, rd_scratch) }; + let less_than = { + let rd_scratch = env.alloc_scratch(); + unsafe { env.test_less_than_signed(&local_rs1, &local_rs2, rd_scratch) } + }; let offset = less_than.clone() * Env::constant(4) + (Env::constant(1) - less_than) * imm0_12;