Skip to content

Commit

Permalink
Gracefully deal with code addresses that are out of range in MutableM…
Browse files Browse the repository at this point in the history
…ethodImplementation

The code addresses in debug info items are not verified, and may be out of
bounds. If this happens, we just clamp them to the maximum code address.
  • Loading branch information
JesusFreke committed Mar 21, 2019
1 parent 580b27f commit 0d4443a
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@ private void fixInstructions() {
private int mapCodeAddressToIndex(@Nonnull int[] codeAddressToIndex, int codeAddress) {
int index;
do {
if (codeAddress >= codeAddressToIndex.length) {
codeAddress = codeAddressToIndex.length - 1;
}
index = codeAddressToIndex[codeAddress];
if (index < 0) {
codeAddress--;
Expand Down

0 comments on commit 0d4443a

Please sign in to comment.