提交 71bf2aa5 编写于 作者: S Skylot

fix: don't apply const split if not needed

上级 714b9354
......@@ -586,6 +586,10 @@ public final class TypeInferenceVisitor extends AbstractVisitor {
}
private boolean checkAndSplitConstInsn(MethodNode mth, SSAVar var) {
ArgType type = var.getTypeInfo().getType();
if (type.isTypeKnown() || var.isTypeImmutable()) {
return false;
}
if (var.getUsedInPhi().size() < 2) {
return false;
}
......
......@@ -17,6 +17,8 @@ public class TestPrimitiveConversion2 extends SmaliTest {
.doesNotContain("z2 == 0")
.doesNotContain("z2 | 2")
.containsOne("(z2 ? 1 : 0) | 2")
.containsOne("if (z2 && formatCurrency != null) {");
.containsOne("if (z2 && formatCurrency != null) {")
.containsOne("i = 1;")
.containsOne("spannable = null;");
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册