This is the mail archive of the java-discuss@sourceware.cygnus.com 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]

Re: Verifier


Kresten Krab Thorup <krab@venus.is.s.u-tokyo.ac.jp> writes:
> Does anyone here know if there is a free verifier available somewhere?
> I looked around briefly on the net, and dit not find one.

Gcj includes a verifier.  Doing verification is basically required
if you want to do reasonable compilation of bytecode to native code.
There are no doubt places where it is not as strict as it should be.
There are other places where the error messages it produces are bad
- and there are no doubt places where bad bytecode could crash the
compiler.  But as I have come across bad bytecode (mostly generated
either by `gcj -C' or by Kawa), I have tried to improve the error
messages.  While it is a work in progress, I do think it goes a
long way to be a good verifier.  The ideal is that gcj should catch
all the format and verification errors that Sun's verifier catches
- and produce a reasonable error message.

The hardcore parts of the verifier are in gcc/java/verify.c.
"Pre-verification" is handled by jcf-parse.c and expr.c.  (The
latter use some excessively clever cpp macros that I now regret.)

To run gcj in "verify-only" mode, try:
        gcj -fsyntax-only -c a.class b.class ...
(though I don't guaratee that it works).
-- 
	--Per Bothner
bothner@pacbell.net  per@bothner.com   http://home.pacbell.net/bothner/

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