8214857: "bad trailing membar" assert failure at memnode.cpp:3220
Reviewed-by: adinn, thartmann
--- a/src/hotspot/share/opto/memnode.cpp Thu Dec 06 12:51:13 2018 +0100
+++ b/src/hotspot/share/opto/memnode.cpp Mon Dec 03 10:51:03 2018 +0100
@@ -3230,7 +3230,7 @@
while (leading != NULL && (!leading->is_MemBar() || !leading->as_MemBar()->leading())) {
while (leading == NULL || leading->is_top() || seen.test_set(leading->_idx)) {
leading = NULL;
- while (regions.size() > 0) {
+ while (regions.size() > 0 && leading == NULL) {
Node* r = regions.node();
uint i = regions.index();
if (i < r->req()) {