Skip to content

Commit

Permalink
Fix up B16 handling with unconditional branch linking and traces
Browse files Browse the repository at this point in the history
  * Don't do eager unconditional branch linking in traces
  * Set up the metadata regardless of whether DBM_LINK_UNCOND_IMM
    is set, for the trace dispatcher.
  • Loading branch information
lgeek committed Nov 9, 2016
1 parent de8969a commit 9d41782
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scanner_thumb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1903,14 +1903,13 @@ size_t scan_thumb(dbm_thread *thread_data, uint16_t *read_address, int basic_blo
break;
}
#endif
#ifdef DBM_LINK_UNCOND_IMM
// Mark this as the beggining of code emulating B
thread_data->code_cache_meta[basic_block].exit_branch_type = uncond_imm_thumb;
thread_data->code_cache_meta[basic_block].exit_branch_addr = write_p;

#ifdef DBM_LINK_UNCOND_IMM
block_address = hash_lookup(&thread_data->entry_address, target);

if (block_address != UINT_MAX && (target & 0x1)) {
if (type == mambo_bb && block_address != UINT_MAX && (target & 0x1)) {
thumb_cc_branch(thread_data, write_p, block_address);
} else {
#endif
Expand Down

0 comments on commit 9d41782

Please sign in to comment.