RFR 8171132: Improve class reading of invalid or out-of-range ConstantValue attributes

Liam Miller-Cushon cushon at google.com
Tue Dec 13 03:29:27 UTC 2016


Hello,

As discussed in:
http://mail.openjdk.java.net/pipermail/compiler-dev/2016-November/010498.html

javac does not currently check for invalid or out-of-range ConstantValue
attributes.

The proposed change is to emit an error for class files where a
ConstantValue attribute disagrees with the field type, and to narrow any
out-of-range values for bool, short, byte or char constant fields to within
the expected range.

Bug: https://bugs.openjdk.java.net/browse/JDK-8171132
Webrev: http://cr.openjdk.java.net/~cushon/8171132/webrev.00

Any feedback is welcome.

Thanks,
Liam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20161212/d39b9ae1/attachment.html>


More information about the compiler-dev mailing list