summaryrefslogtreecommitdiff
path: root/vm/reference
diff options
context:
space:
mode:
authorJohn Keiser <shalom@gnu.org>1998-11-01 21:21:29 +0000
committerJohn Keiser <shalom@gnu.org>1998-11-01 21:21:29 +0000
commitd392281f1a1517d1466012c122ca2c658f639a37 (patch)
tree8e6891822e85002496208d99e9476f130330ce2e /vm/reference
parent7c943fe63c2de1024bf5779945f781e96cc9197c (diff)
downloadclasspath-d392281f1a1517d1466012c122ca2c658f639a37.tar.gz
Fixed minor error-checking bug, preventing possible infinite loop.
Diffstat (limited to 'vm/reference')
-rw-r--r--vm/reference/gnu/vm/stack/StackTrace.java8
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];
}