the exception handler is dead cause NPE in unssa

fix https://github.com/pxb1988/dex2jar/issues/477
This commit is contained in:
Bob Pan 2021-10-30 18:47:53 +08:00
parent f028437d46
commit 80a81b317f
3 changed files with 10 additions and 1 deletions

View File

@ -361,6 +361,8 @@ public class UnSSATransformer implements Transformer {
}
tos.clear();
} else if (stmt.st == ST.LABEL) { //
// https://github.com/pxb1988/dex2jar/issues/477
// the exception handler is dead and stmt.frame is null
LabelStmt label = (LabelStmt) stmt;
if (label.phis != null) {
for (AssignStmt phiAssignStmt : (List<AssignStmt>) label.phis) {

View File

@ -646,7 +646,14 @@ public class Dex2Asm {
T_multiArray.transform(irMethod);
T_voidInvoke.transform(irMethod);
T_type.transform(irMethod);
T_unssa.transform(irMethod);
{
// https://github.com/pxb1988/dex2jar/issues/477
// dead code found in unssa, clean up
T_deadCode.transform(irMethod);
T_removeLocal.transform(irMethod);
T_removeConst.transform(irMethod);
T_unssa.transform(irMethod);
}
T_trimEx.transform(irMethod);
T_ir2jRegAssign.transform(irMethod);
}