summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chao-ying Fu <chao-ying.fu@intel.com> 2014-07-07 17:13:52 -0700
committer Mark Mendell <mark.p.mendell@intel.com> 2014-07-09 14:31:42 -0400
commit8159af6320f7413a9d0fff1e29220c01f29c6e96 (patch)
tree9beed9adb2744b6a2eac5bb20b4fcdf53d695ed4
parent32710dd4a0232149002a5ae7bde1c640cdffd564 (diff)
ART: Check slow_paths_.Size() every time
This patch fixes a bug, when a new slow path is created during slowpath->Compile(). Change-Id: I4896a82781102694c25f4483112c6de3c56e072c Signed-off-by: Chao-ying Fu <chao-ying.fu@intel.com>
-rw-r--r--compiler/dex/quick/gen_common.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/dex/quick/gen_common.cc b/compiler/dex/quick/gen_common.cc
index dafefea0a3..b31e9a2efa 100644
--- a/compiler/dex/quick/gen_common.cc
+++ b/compiler/dex/quick/gen_common.cc
@@ -766,8 +766,9 @@ void Mir2Lir::GenSget(MIR* mir, RegLocation rl_dest,
// Generate code for all slow paths.
void Mir2Lir::HandleSlowPaths() {
- int n = slow_paths_.Size();
- for (int i = 0; i < n; ++i) {
+ // We should check slow_paths_.Size() every time, because a new slow path
+ // may be created during slowpath->Compile().
+ for (size_t i = 0; i < slow_paths_.Size(); ++i) {
LIRSlowPath* slowpath = slow_paths_.Get(i);
slowpath->Compile();
}