core: use correct argument wrap method

This commit is contained in:
Skylot
2013-12-24 22:23:12 +04:00
parent 43913d47ec
commit 4caa58f5fd
3 changed files with 3 additions and 33 deletions
@@ -35,7 +35,7 @@ public abstract class InsnArg extends Typed {
return lit(insn.getLiteral(), type);
}
public static InsnWrapArg wrap(InsnNode insn) {
private static InsnWrapArg wrap(InsnNode insn) {
return new InsnWrapArg(insn);
}
@@ -81,7 +81,7 @@ public abstract class InsnArg extends Typed {
return null;
}
private static InsnArg wrapArg(InsnNode insn) {
public static InsnArg wrapArg(InsnNode insn) {
InsnArg arg;
switch (insn.getType()) {
case MOVE:
@@ -1,30 +0,0 @@
package jadx.core.dex.instructions.mods;
import jadx.core.dex.instructions.IfNode;
import jadx.core.dex.instructions.IfOp;
import jadx.core.dex.instructions.InsnType;
import jadx.core.dex.instructions.args.InsnArg;
import jadx.core.dex.nodes.InsnNode;
import jadx.core.utils.InsnUtils;
import jadx.core.utils.Utils;
public class TernaryInsn extends IfNode {
public TernaryInsn(IfOp op, InsnNode then, InsnNode els) {
super(then.getOffset(),
InsnArg.wrap(then),
els == null ? null : InsnArg.wrap(els));
}
@Override
public InsnType getType() {
return InsnType.TERNARY;
}
@Override
public String toString() {
return InsnUtils.formatOffset(offset) + ": TERNARY"
+ getResult() + " = "
+ Utils.listToString(getArguments());
}
}
@@ -165,7 +165,7 @@ public class SimplifyVisitor extends AbstractVisitor {
for (int i = 1; i < argsCount; i++) {
concat.addArg(wrap.getArg(i));
}
return new ArithNode(ArithOp.ADD, fArg, fArg, InsnArg.wrap(concat));
return new ArithNode(ArithOp.ADD, fArg, fArg, InsnArg.wrapArg(concat));
}
} catch (Throwable e) {
LOG.debug("Can't convert field arith insn: {}, mth: {}", insn, mth, e);