Skip to content

Commit 921c300

Browse files
committed
Clear block only needs when retranslate
1 parent 9fe2ce7 commit 921c300

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/emulate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,6 @@ FORCE_INLINE bool insn_is_unconditional_branch(uint8_t opcode)
567567
static void block_translate(riscv_t *rv, block_t *block)
568568
{
569569
retranslate:
570-
memset(block, 0, sizeof(block_t));
571570
block->pc_start = block->pc_end = rv->PC;
572571

573572
rv_insn_t *prev_ir = NULL;
@@ -584,6 +583,7 @@ static void block_translate(riscv_t *rv, block_t *block)
584583

585584
#if RV32_HAS(SYSTEM)
586585
if (!insn && need_retranslate) {
586+
memset(block, 0, sizeof(block_t));
587587
need_retranslate = false;
588588
goto retranslate;
589589
}

0 commit comments

Comments
 (0)