diff options
author | John Keiser <shalom@gnu.org> | 1998-11-01 21:21:29 +0000 |
---|---|---|
committer | John Keiser <shalom@gnu.org> | 1998-11-01 21:21:29 +0000 |
commit | d392281f1a1517d1466012c122ca2c658f639a37 (patch) | |
tree | 8e6891822e85002496208d99e9476f130330ce2e /vm/reference | |
parent | 7c943fe63c2de1024bf5779945f781e96cc9197c (diff) | |
download | classpath-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.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]; } |