projects
/
org.ibex.classgen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d1f8b6e
)
better stack overflow checking
author
brian
<brian@brianweb.net>
Sun, 3 Jul 2005 21:20:54 +0000
(21:20 +0000)
committer
brian
<brian@brianweb.net>
Sun, 3 Jul 2005 21:20:54 +0000
(21:20 +0000)
darcs-hash:
20050703212054
-24bed-
0c076787f9d19b0302889267fcf497cad530b92d
.gz
src/org/ibex/classgen/JSSA.java
patch
|
blob
|
history
diff --git
a/src/org/ibex/classgen/JSSA.java
b/src/org/ibex/classgen/JSSA.java
index
f3835ae
..
8582df2
100644
(file)
--- a/
src/org/ibex/classgen/JSSA.java
+++ b/
src/org/ibex/classgen/JSSA.java
@@
-74,7
+74,11
@@
public class JSSA extends MethodGen implements CGConst {
private int sp = 0;
private Expr push(Expr e) {
private int sp = 0;
private Expr push(Expr e) {
- if(sp == stack.length-1) throw new IllegalStateException("stack overflow");
+ if(sp == stack.length) {
+ for(int i=0;i<stack.length;i++) System.err.println("Stack " + i + ": " + stack[i]);
+ throw new IllegalStateException("stack overflow (" + stack.length + ")");
+ }
+ if(e.getType() == Type.VOID) throw new IllegalArgumentException("can't push a void");
return stack[sp++] = e;
}
private Expr pop() {
return stack[sp++] = e;
}
private Expr pop() {