8229970: ZGC: C2: fixup_uses_in_catch may fail when expanding many uses
authorneliasso
Fri, 23 Aug 2019 10:11:18 +0200
changeset 57854 8b8d8a1621f2
parent 57853 3029be26f9ea
child 57855 00bf1e66de11
8229970: ZGC: C2: fixup_uses_in_catch may fail when expanding many uses Reviewed-by: kvn, thartmann
src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
--- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp	Fri Aug 23 10:11:00 2019 +0200
+++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp	Fri Aug 23 10:11:18 2019 +0200
@@ -1001,16 +1001,12 @@
   // Process the loads successor nodes - if any is between
   // the call and the catch blocks, they need to be cloned to.
   // This is done recursively
-  int outcnt = load->outcnt();
-  uint index = 0;
-  for (int i = 0; i < outcnt; i++) {
-    if (index < load->outcnt()) {
-      Node *n = load->raw_out(index);
-      assert(!n->is_LoadBarrier(), "Sanity");
-      if (!fixup_uses_in_catch(phase, ctrl, n)) {
-        // if no successor was cloned, progress to next out.
-        index++;
-      }
+  for (uint i = 0; i < load->outcnt();) {
+    Node *n = load->raw_out(i);
+    assert(!n->is_LoadBarrier(), "Sanity");
+    if (!fixup_uses_in_catch(phase, ctrl, n)) {
+      // if no successor was cloned, progress to next out.
+      i++;
     }
   }