hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp
changeset 17036 4818f717d362
parent 16620 294771974de2
child 22234 da823d78ad65
--- a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp	Tue Apr 16 17:06:39 2013 +0200
+++ b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp	Wed Apr 24 09:42:08 2013 +0200
@@ -459,7 +459,7 @@
 
     // Iterate over all different indices
     if (_optimistic) {
-      for (int i=0; i<indices.length(); i++) {
+      for (int i = 0; i < indices.length(); i++) {
         Instruction *index_instruction = indices.at(i);
         AccessIndexedInfo *info = _access_indexed_info[index_instruction->id()];
         assert(info != NULL, "Info must not be null");
@@ -531,9 +531,7 @@
             remove_range_check(ai);
           }
         }
-        _access_indexed_info[index_instruction->id()] = NULL;
       }
-      indices.clear();
 
       if (list_constant.length() > 1) {
         AccessIndexed *first = list_constant.at(0);
@@ -560,6 +558,13 @@
         }
       }
     }
+
+    // Clear data structures for next array
+    for (int i = 0; i < indices.length(); i++) {
+      Instruction *index_instruction = indices.at(i);
+      _access_indexed_info[index_instruction->id()] = NULL;
+    }
+    indices.clear();
   }
 }