src/hotspot/share/prims/forte.cpp
changeset 48823 99c973b56994
parent 47216 71c04702a3d5
child 49359 59f6547e151f
--- a/src/hotspot/share/prims/forte.cpp	Wed Jan 31 16:48:41 2018 +0100
+++ b/src/hotspot/share/prims/forte.cpp	Wed Jan 31 11:07:55 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -133,7 +133,7 @@
     // By the time we get here we should never see unsafe but better
     // safe then segv'd
 
-    if (loop_count > loop_max || !_frame.safe_for_sender(_thread)) {
+    if ((loop_max != 0 && loop_count > loop_max) || !_frame.safe_for_sender(_thread)) {
       _mode = at_end_mode;
       return;
     }
@@ -324,7 +324,7 @@
     int loop_max = MaxJavaStackTraceDepth * 2;
     RegisterMap map(thread, false);
 
-    for (loop_count = 0; loop_count < loop_max; loop_count++) {
+    for (loop_count = 0; loop_max == 0 || loop_count < loop_max; loop_count++) {
       if (!candidate.safe_for_sender(thread)) return false;
       candidate = candidate.sender(&map);
       if (candidate.cb() != NULL) break;
@@ -338,7 +338,7 @@
   int loop_max = MaxJavaStackTraceDepth * 2;
   RegisterMap map(thread, false);
 
-  for (loop_count = 0; loop_count < loop_max; loop_count++) {
+  for (loop_count = 0; loop_max == 0 || loop_count < loop_max; loop_count++) {
 
     if (candidate.is_entry_frame()) {
       // jcw is NULL if the java call wrapper couldn't be found