Handle super call processing error

This commit is contained in:
Skylot 2013-03-21 23:43:25 +04:00
parent 918e566c56
commit baa14e9d23

View File

@ -19,6 +19,7 @@ import jadx.dex.trycatch.ExcHandlerAttr;
import jadx.dex.trycatch.ExceptionHandler;
import jadx.dex.trycatch.TryCatchBlock;
import jadx.utils.BlockUtils;
import jadx.utils.exceptions.JadxRuntimeException;
import java.util.ArrayList;
import java.util.List;
@ -61,8 +62,9 @@ public class ModVisitor extends AbstractVisitor {
MethodInfo callMth = inv.getCallMth();
if (callMth.isConstructor()) {
ConstructorInsn co = new ConstructorInsn(mth, inv);
// don't call 'super' if parent 'Object'
if (co.isSuper()) {
try {
// don't call 'super' if parent 'Object'
if (!co.getClassType().getFullName().equals(Consts.CLASS_OBJECT)) {
for (int j = 0; j < co.getArgsCount(); j++) {
InsnArg arg = co.getArg(j);
@ -74,6 +76,11 @@ public class ModVisitor extends AbstractVisitor {
mth.setSuperCall(co);
}
remover.add(insn);
} catch (JadxRuntimeException e) {
// inline args into super fail
LOG.warn("Can't inline args into super call: " + inv + ", mth: " + mth);
replaceInsn(block, i, co);
}
} else if (co.isThis() && co.getArgsCount() == 0) {
MethodNode defCo = mth.getParentClass().searchMethodById(co.getCallMth().getShortId());
if (defCo == null || defCo.isNoCode()) {