Commit 4caa58f5 authored by Skylot's avatar Skylot

core: use correct argument wrap method

parent 43913d47
...@@ -35,7 +35,7 @@ public abstract class InsnArg extends Typed { ...@@ -35,7 +35,7 @@ public abstract class InsnArg extends Typed {
return lit(insn.getLiteral(), type); return lit(insn.getLiteral(), type);
} }
public static InsnWrapArg wrap(InsnNode insn) { private static InsnWrapArg wrap(InsnNode insn) {
return new InsnWrapArg(insn); return new InsnWrapArg(insn);
} }
...@@ -81,7 +81,7 @@ public abstract class InsnArg extends Typed { ...@@ -81,7 +81,7 @@ public abstract class InsnArg extends Typed {
return null; return null;
} }
private static InsnArg wrapArg(InsnNode insn) { public static InsnArg wrapArg(InsnNode insn) {
InsnArg arg; InsnArg arg;
switch (insn.getType()) { switch (insn.getType()) {
case MOVE: case MOVE:
......
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 { ...@@ -165,7 +165,7 @@ public class SimplifyVisitor extends AbstractVisitor {
for (int i = 1; i < argsCount; i++) { for (int i = 1; i < argsCount; i++) {
concat.addArg(wrap.getArg(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) { } catch (Throwable e) {
LOG.debug("Can't convert field arith insn: {}, mth: {}", insn, mth, e); LOG.debug("Can't convert field arith insn: {}, mth: {}", insn, mth, e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment