Dalvik-Frontend: add catch-all handler at the end and not at the beginning

This commit is contained in:
Martin Mohr 2016-12-09 16:30:05 +01:00
parent 9ada546c5d
commit ee22e177c5
1 changed files with 6 additions and 7 deletions

View File

@ -651,6 +651,12 @@ public class DexIMethod implements IBytecodeMethod {
endInst = getInstructionIndex(endAddress) - 1;
}
for (int i = startInst; i <= endInst; i++) {
//add the rest of the handlers
for (EncodedTypeAddrPair etaps: tryItem.encodedCatchHandler.handlers) {
temp_array.get(i).add(new ExceptionHandler( getInstructionIndex(etaps.getHandlerAddress()), etaps.exceptionType.getTypeDescriptor() ));
}
}
//add the catch all handler if it exists
int catchAllAddress = tryItem.encodedCatchHandler.getCatchAllHandlerAddress();
if (catchAllAddress != -1) {
@ -664,13 +670,6 @@ public class DexIMethod implements IBytecodeMethod {
}
//throw new UnimplementedError("DexIMethod->handlers: getCatchAllHandlerAddress() not yet implemented");
}
for (int i = startInst; i <= endInst; i++) {
//add the rest of the handlers
for (EncodedTypeAddrPair etaps: tryItem.encodedCatchHandler.handlers) {
temp_array.get(i).add(new ExceptionHandler( getInstructionIndex(etaps.getHandlerAddress()), etaps.exceptionType.getTypeDescriptor() ));
}
}
}