Removes part that checks for throwing half of instruction. It's no
longer necessary. Also adds regression test.
Bug:
21902684
Change-Id: Ic600165e6b3719de3d83a73b8a1fa64473668fc8
if (opcode == Instruction::NEW_INSTANCE) {
uint32_t type_idx = mir->dalvikInsn.vB;
if (cu_->compiler_driver->IsStringTypeIndex(type_idx, cu_->dex_file)) {
- // Change NEW_INSTANCE and throwing half of the insn (if it exists) into CONST_4 of 0
+ // Change NEW_INSTANCE into CONST_4 of 0
mir->dalvikInsn.opcode = Instruction::CONST_4;
mir->dalvikInsn.vB = 0;
- MIR* check_mir = GetBasicBlock(bb->predecessors[0])->last_mir_insn;
- if (check_mir != nullptr &&
- static_cast<int>(check_mir->dalvikInsn.opcode) == kMirOpCheck) {
- check_mir->dalvikInsn.opcode = static_cast<Instruction::Code>(kMirOpNop);
- check_mir->dalvikInsn.vB = 0;
- }
}
} else if ((opcode == Instruction::INVOKE_DIRECT) ||
(opcode == Instruction::INVOKE_DIRECT_RANGE)) {
b/20224106
b/21873167
b/21614284
+b/21902684
Done!
--- /dev/null
+.class public LB21902684;
+.super Ljava/lang/Object;
+
+.method public constructor <init>()V
+ .registers 1
+ invoke-direct {p0}, Ljava/lang/Object;-><init>()V
+ return-void
+.end method
+
+.method public test()V
+ .registers 1
+ goto :end
+ new-instance v0, Ljava/lang/String;
+ invoke-direct {v0}, Ljava/lang/String;-><init>()V
+ :end
+ return-void
+.end method
testCases.add(new TestCase("b/21873167", "B21873167", "test", null, null, null));
testCases.add(new TestCase("b/21614284", "B21614284", "test", new Object[] { null },
new NullPointerException(), null));
+ testCases.add(new TestCase("b/21902684", "B21902684", "test", null, null, null));
}
public void runTests() {