[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug when unusual traps



hi,
i just created the following *legal* bytecode, that crashes SOOT (Jasmin
    complains):

==============JASMIN-FILE
;
; Output created by D-Java (mailto:umsilve1@cc.umanitoba.ca)
;

;Classfile version:
;    Major: 45
;    Minor: 3

.source TT.java
.class  public synchronized TT
.super  java/lang/Object



; >> METHOD 1 <<
.method public <init>()V
    .limit stack 1
    .limit locals 1
.line 1
    aload_0
    invokenonvirtual java/lang/Object/<init>()V
    return
.end method

; >> METHOD 2 <<
.method public static main([Ljava/lang/String;)V
    .limit stack 3
    .limit locals 2
.catch java/lang/Exception from Label1 to Label3 using Label2
Label1:
    iconst_2
    istore_1
    new java/lang/ArithmeticException
    dup
    ldc "pech gehabt"
    invokenonvirtual java/lang/ArithmeticException/<init>(Ljava/lang/String;)V
Label2:
    astore_1
    getstatic java/lang/System/out Ljava/io/PrintStream;
    aload_1
    invokevirtual java/io/PrintStream/println(Ljava/lang/Object;)V
Label3:
    return
.end method



here's the error:
==================ERROR-OUTPUT
Soot started on Thu Mar 07 23:56:58 EST 2002
Transforming TT... java.lang.RuntimeException: Negative Stack height has been
attained: 
StackHeight: -1
At instruction:store.r r0
Block:
Block 0:
[preds: ] [succs: ]
r0 := @parameter0;
push 2;
store.b r0;
new java.lang.ArithmeticException;
push "pech gehabt";
specialinvoke <init>;
store.r r0;
staticget java.lang.System.out;
load.r r0;
virtualinvoke println;
return;


Method: main
<TT: void main(java.lang.String[])>
        at soot.baf.JasminClass.calculateStackHeight(JasminClass.java:2084)
          at soot.baf.JasminClass.emitMethodBody(JasminClass.java:619)
          at soot.baf.JasminClass.emitMethod(JasminClass.java:396)
          at soot.baf.JasminClass.<init>(JasminClass.java:303)
          at soot.SootClass.write(SootClass.java:969)
          at soot.Main.handleClass(Main.java:1859)
          at soot.Main.run(Main.java:1557)
          at java.lang.Thread.run(Thread.java:484)

  Soot finished on Thu Mar 07 23:57:07 EST 2002
  Soot has run for 0 min. 9 sec.


mfg
 florian loitsch
-- 
People who think they know everything are very irritating to those of us who do.
- Anon.