Skip to content

Commit

Permalink
Update OatCFGParser's jump target format (compiler-explorer#6909)
Browse files Browse the repository at this point in the history
We need to account for latest versions of dex2oat saving jump targets in
non-truncated form, for example,

(old) "b #+0x28 (addr 0x416c)" vs. (new) "b.hs #+0x24 (addr 0x00008074)"
  • Loading branch information
kevinjeon-g authored Sep 26, 2024
1 parent 870e3b3 commit d54e2ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/cfg/cfg-parsers/oat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,12 @@ export class OatCFGParser extends BaseCFGParser {
return result;
}

// In this example, '0x416c' will be returned.
// In these examples, '0x416c' and '0x8074' will be returned.
// 0x00004144 b #+0x28 (addr 0x416c)
// 0x00008050 b.hs #+0x24 (addr 0x00008074)
getJmpAddr(inst: string): string {
const match = inst.match(this.jmpAddrRegex);
if (match) return match[1];
if (match) return this.shortenHex(match[1]);
return '';
}

Expand Down

0 comments on commit d54e2ba

Please sign in to comment.