Skip to content

Commit 738477b

Browse files
committed
Fix JIT register allocation conflict in lb
This uses map_vm_reg_reserved instead of map_vm_reg when allocating vm_reg[1] to avoid conflicts with already-allocated vm_reg[0], ensuring proper register allocation in the load byte instruction generator.
1 parent 558e438 commit 738477b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rv32_jit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ GEN(lb, {
180180
emit_cmp_imm32(state, temp_reg, 0);
181181
uint32_t jump_loc_0 = state->offset;
182182
emit_jcc_offset(state, 0x84);
183-
vm_reg[1] = map_vm_reg(state, ir->rd);
183+
vm_reg[1] = map_vm_reg_reserved(state, ir->rd, vm_reg[0]);
184184

185185
emit_load(state, S32, parameter_reg[0], vm_reg[1],
186186
offsetof(riscv_t, X) + 4 * ir->rd);

0 commit comments

Comments
 (0)