diff options
-rw-r--r-- | vm/reference/gnu/vm/stack/StackTrace.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/vm/reference/gnu/vm/stack/StackTrace.java b/vm/reference/gnu/vm/stack/StackTrace.java index 2bab71363..ea4c3f42d 100644 --- a/vm/reference/gnu/vm/stack/StackTrace.java +++ b/vm/reference/gnu/vm/stack/StackTrace.java @@ -47,8 +47,12 @@ public class StackTrace { } public synchronized StackFrame pop() { - if(len == 0) - throw new ArrayIndexOutOfBoundsException("stack trace empty."); + if(len <= 0) + return null; + //Note: cannot throw exception here, since this method + //is used in exception throwing itself and could cause + //an infinite loop. + //throw new ArrayIndexOutOfBoundsException("stack trace empty."); len--; return frames[len]; } |