43bc7e
# HG changeset patch
43bc7e
# User roland
43bc7e
# Date 1506520357 -7200
43bc7e
#      Wed Sep 27 15:52:37 2017 +0200
43bc7e
# Node ID c307975d0800f8da5cc8e82cd8f1fdadbd745357
43bc7e
# Parent  ab0c101fa16e4cd97ac8ceff4f5ff72e2f4d5776
43bc7e
[backport] fix TCK crash with shenandoah
43bc7e
43bc7e
diff --git a/src/share/vm/opto/shenandoahSupport.cpp b/src/share/vm/opto/shenandoahSupport.cpp
43bc7e
--- openjdk/hotspot/src/share/vm/opto/shenandoahSupport.cpp
43bc7e
+++ openjdk/hotspot/src/share/vm/opto/shenandoahSupport.cpp
43bc7e
@@ -472,9 +472,11 @@
43bc7e
   Node* input = in(Memory);
43bc7e
   if (input->Opcode() == Op_ShenandoahWBMemProj) {
43bc7e
     Node* wb = input->in(0);
43bc7e
-    if (wb->is_top()) return NULL; // Dead path.
43bc7e
+    const Type* in_type = phase->type(wb);
43bc7e
+    // is_top() test not sufficient here: we can come here after CCP
43bc7e
+    // in a dead branch of the graph that has not yet been removed.
43bc7e
+    if (in_type == Type::TOP) return NULL; // Dead path.
43bc7e
     assert(wb->Opcode() == Op_ShenandoahWriteBarrier, "expect write barrier");
43bc7e
-    const Type* in_type = phase->type(wb);
43bc7e
     if (is_independent(in_type, _type)) {
43bc7e
       if (phase->is_IterGVN()) {
43bc7e
         phase->is_IterGVN()->rehash_node_delayed(wb);