Hi John, hi Christian, hi all,
The logic in classFileParser.cpp around line 148 outputs
the wrong error message "This JVM does not support ..."
when a class file with a major version 50 contains a new constant pool 
constant
if method handles support is not enable.
It should output "Class file version does not support constant ..." instead.

The problem is that if the two conditions are true, the error message
should be "This JVM does not support ..." and not "Class file version 
does not support...".

the code:
case JVM_CONSTANT_MethodType :
         if (!EnableMethodHandles ||
             _major_version < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
           classfile_parse_error(
             (!EnableMethodHandles ?
              "This JVM does not support constant tag %u in class file %s" :
              "Class file version does not support constant tag %u in 
class file %s"),
             tag, CHECK);
         }

should be replaced by:
case JVM_CONSTANT_MethodType :
         if (!EnableMethodHandles ||
             _major_version < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
           classfile_parse_error(
             (_major_version < Verifier::INVOKEDYNAMIC_MAJOR_VERSION ?
              "Class file version does not support constant tag %u in 
class file %s":
               "This JVM does not support constant tag %u in class file 
%s"),
             tag, CHECK);
         }

the code for constant InvokeDynamic (20 lines below) should be also changed
in the same way.

Rémi


_______________________________________________
mlvm-dev mailing list
[email protected]
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

Reply via email to