Skip to content

Commit

Permalink
Clear block only needs when retranslate
Browse files Browse the repository at this point in the history
  • Loading branch information
ChinYikMing committed Nov 2, 2024
1 parent 2163a76 commit 6466aa1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,6 @@ FORCE_INLINE bool insn_is_unconditional_branch(uint8_t opcode)
static void block_translate(riscv_t *rv, block_t *block)
{
retranslate:
memset(block, 0, sizeof(block_t));
block->pc_start = block->pc_end = rv->PC;

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

#if RV32_HAS(SYSTEM)
if (!insn && need_retranslate) {
memset(block, 0, sizeof(block_t));
need_retranslate = false;
goto retranslate;
}
Expand Down

0 comments on commit 6466aa1

Please sign in to comment.