aboutsummaryrefslogtreecommitdiff
path: root/common/src/main/java/com/sk89q
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/main/java/com/sk89q')
-rw-r--r--common/src/main/java/com/sk89q/warmroast/StackNode.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/src/main/java/com/sk89q/warmroast/StackNode.java b/common/src/main/java/com/sk89q/warmroast/StackNode.java
index f077309..8fd0661 100644
--- a/common/src/main/java/com/sk89q/warmroast/StackNode.java
+++ b/common/src/main/java/com/sk89q/warmroast/StackNode.java
@@ -36,6 +36,8 @@ import java.util.Map;
*/
public class StackNode implements Comparable<StackNode> {
+ private static final int MAX_STACK_DEPTH = 300;
+
/**
* The name of this node
*/
@@ -87,6 +89,10 @@ public class StackNode implements Comparable<StackNode> {
private void log(StackTraceElement[] elements, int skip, long time) {
accumulateTime(time);
+
+ if (skip >= MAX_STACK_DEPTH) {
+ return;
+ }
if (elements.length - skip == 0) {
return;