This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bytecode verifier


Andrew Haley wrote:
> Ranjit Mathew writes:
>  > BTW, as has been pointed earlier, Sun's JVM doesn't
>  > even bother verifying classes loaded locally unless
>  > you use the "-verify" flag, so maybe even we ought
>  > not to bother by default.
> 
> Interesting.

Wait!! That's wrong - it seems to be valid only for
classes in the *bootstrap* CLASSPATH (bootclasspath):
------------------------------ 8< ------------------------------
$ java -version
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
$
$ java simple.fail.verify1
Exception in thread "main" java.lang.VerifyError: (class: simple/fail/verify1, m
ethod: main signature: ([Ljava/lang/String;)V) Unable to pop operand off an empt
y stack
$
$ java -noverify simple.fail.verify1
$
$ java -Xbootclasspath:.:/usr/java/j2sdk1.4.2_03/jre/lib/rt.jar simple.fail.veri
fy1
$
$ java -verify -Xbootclasspath:.:/usr/java/j2sdk1.4.2_03/jre/lib/rt.jar simple.f
ail.verify1
Exception in thread "main" java.lang.VerifyError: (class: simple/fail/verify1, m
ethod: main signature: ([Ljava/lang/String;)V) Unable to pop operand off an empt
y stack
------------------------------ 8< ------------------------------

Sorry for the noise! :-(

Ranjit.

-- 
Ranjit Mathew          Email: rmathew AT hotmail DOT com

Bangalore, INDIA.      Web: http://ranjitmathew.tripod.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]