[Vm-dev] I really don't understand why this doesn't crash
Michael Haupt
mhaupt at gmail.com
Sat Jun 18 21:10:06 UTC 2011
Hi,
Am 18.06.2011 um 20:43 schrieb stephane ducasse <stephane.ducasse at gmail.com>:
>
>>
>> As a note, the Java VM and the Flash VM, at least, have strong bytecode
>> verifiers specifically for security reasons.
>
> do they verify at execution time and cache?
verification takes place at load time, for all classes as they are loaded. Not afterwards. Also, keep in mind that Java's type system allows some guarantees once code is verified. (What do you mean by "cache"?)
> I checked a while ago but there were essentially checking that the stack was balanced...
> but it was long time ago.
They do a lot more than that. :-)
>
Check the spec:
http://java.sun.com/docs/books/jvms/second_edition/html/ConstantPool.doc.html#71817
http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#40222
http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#88597
Especially the second link is worthwhile.
Best,
Michael
More information about the Vm-dev
mailing list