From 35ba7f3a78d38885ec54e61ed060d2771eeceea7 Mon Sep 17 00:00:00 2001 From: buzbee Date: Sat, 31 May 2014 08:59:01 -0700 Subject: 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 --- compiler/dex/frontend.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/dex/frontend.cc') diff --git a/compiler/dex/frontend.cc b/compiler/dex/frontend.cc index 1570c3a241..6bb22846cd 100644 --- a/compiler/dex/frontend.cc +++ b/compiler/dex/frontend.cc @@ -758,7 +758,7 @@ static bool CanCompileMethod(uint32_t method_idx, const DexFile& dex_file, // Check if we support the byte code. if (std::find(support_list, support_list + support_list_size, opcode) == support_list + support_list_size) { - if (opcode < kMirOpFirst) { + if (!cu.mir_graph->IsPseudoMirOp(opcode)) { VLOG(compiler) << "Unsupported dalvik byte code : " << mir->dalvikInsn.opcode; } else { -- cgit v1.2.3-59-g8ed1b