Skip to content

Commit 892bc37

Browse files
authored
Merge pull request #462 from ChinYikMing/branch-history-tbl-init
Initialize ir->branch_table->PC with safe value
2 parents ef151e2 + b65d24c commit 892bc37

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/emulate.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,8 @@ static void block_translate(riscv_t *rv, block_t *block)
617617
) {
618618
ir->branch_table = calloc(1, sizeof(branch_history_table_t));
619619
assert(ir->branch_table);
620+
memset(ir->branch_table->PC, -1,
621+
sizeof(uint32_t) * HISTORY_SIZE);
620622
}
621623
break;
622624
}

0 commit comments

Comments
 (0)