You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-user@jakarta.apache.org by Luca Martini <lu...@inwind.it> on 2003/09/16 19:56:15 UTC
problem with the bytecode verifier
Hi.
I'm using the bytecode verifier included in the BCEL (JustIce).
It seems that JustIce accepts some codes that the native verifier rejects.
In particular, it seems that the verifier does not check if the value returned
by a method is a subtype of the type displayed in the method signature.
I also downloaded from CVS the latest version of the BCEL but the problem
persists.
Am I missing something?
Thanks in advance,
Luca
an example of a toy-class, that native verifier rejects and JustIce not, follows
in Jasmin-syntax:
(the method m returns this as an integer !!)
--------------------------------------------------
;; Produced by JasminVisitor (BCEL)
;; http://bcel.sourceforge.net/
;; Tue Sep 16 18:10:25 CEST 2003
.source prova.java
.class public prova
.super java/lang/Object
.field public i I
.field public p Lprova;
.method public <init>()V
.limit stack 2
.limit locals 1
.var 0 is this Lprova; from Label0 to Label1
Label0:
.line 1
aload_0
invokespecial java/lang/Object/<init>()V
.line 2
aload_0
iconst_0
putfield prova.i I
.line 3
aload_0
aconst_null
putfield prova.p Lprova;
Label1:
.line 1
return
.end method
.method public m()I
.limit stack 3
.limit locals 1
.var 0 is this Lprova; from Label0 to Label1
Label0:
.line 5
aload_0
dup
getfield prova.i I
iconst_1
iadd
putfield prova.i I
.line 6
aload_0
Label1:
areturn
.end method