Gracefully deal with code addresses that are out of range in MutableMethodImplementation

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.
This commit is contained in:
Ben Gruver 2019-03-21 13:41:00 -07:00
parent 580b27f379
commit 0d4443a19a

View File

@ -473,6 +473,9 @@ public class MutableMethodImplementation implements MethodImplementation {
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--;