summaryrefslogtreecommitdiffstats
path: root/compiler/dex/mir_dataflow.cc
diff options
context:
space:
mode:
authorbuzbee <buzbee@google.com>2014-05-31 08:59:01 -0700
committerbuzbee <buzbee@google.com>2014-05-31 09:07:15 -0700
commit35ba7f3a78d38885ec54e61ed060d2771eeceea7 (patch)
treeec2d7963f38205bf5eae6b1a35b3f85d0e1da4f8 /compiler/dex/mir_dataflow.cc
parente4e04bbd86d1131b9f380a52a46b1a3b83335d5f (diff)
downloadandroid_art-35ba7f3a78d38885ec54e61ed060d2771eeceea7.tar.gz
android_art-35ba7f3a78d38885ec54e61ed060d2771eeceea7.tar.bz2
android_art-35ba7f3a78d38885ec54e61ed060d2771eeceea7.zip
Quick compiler: fix array overrun.
MIRGraph::InlineCalls() was using the MIR opcode to recover Dalvik instruction flags - something that is only valid for Dalvik opcodes and not the set of extended MIR opcodes. This is probably the 3rd or 4th time we've had a bug using the MIR opcode in situations that are only valid for the Dalvik opcode subset. I took the opportunity to scan the code for other cases of this (didn't find any), and did some cleanup while I was in the neighborhood. We should probably rework the DalvikOpcode/MirOpcode model whenver we get around to removing DalvikInstruction from MIR. Internal bug b/15352667: out-of-bound access in mir_optimization.cc Change-Id: I75f06780468880892151e3cdd313e14bfbbaa489
Diffstat (limited to 'compiler/dex/mir_dataflow.cc')
-rw-r--r--compiler/dex/mir_dataflow.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/dex/mir_dataflow.cc b/compiler/dex/mir_dataflow.cc
index 5ff62743ce..9fea709568 100644
--- a/compiler/dex/mir_dataflow.cc
+++ b/compiler/dex/mir_dataflow.cc
@@ -1015,8 +1015,7 @@ bool MIRGraph::DoSSAConversion(BasicBlock* bb) {
uint64_t df_attributes = GetDataFlowAttributes(mir);
// If not a pseudo-op, note non-leaf or can throw
- if (static_cast<int>(mir->dalvikInsn.opcode) <
- static_cast<int>(kNumPackedOpcodes)) {
+ if (!IsPseudoMirOp(mir->dalvikInsn.opcode)) {
int flags = Instruction::FlagsOf(mir->dalvikInsn.opcode);
if ((flags & Instruction::kInvoke) != 0 && (mir->optimization_flags & MIR_INLINED) == 0) {