Commit f1825347 authored by Remi Forax's avatar Remi Forax

Merge branch 'support_java_14' into 'master'

add support of Java 14 version

See merge request asm/asm!264
parents bec81fba 2bbad09f
......@@ -288,7 +288,7 @@ public class ClassFile {
builder.add("magic: ", parser.u4());
builder.add("minor_version: ", parser.u2());
int majorVersion = parser.u2();
if (majorVersion > /* V12 = */ 56) {
if (majorVersion > /* V14 = */ 58) {
throw new ClassFormatException("Unsupported class version");
}
builder.add("major_version: ", majorVersion);
......
......@@ -103,6 +103,7 @@ public class ASMifier extends Printer {
classVersions.put(Opcodes.V11, "V11");
classVersions.put(Opcodes.V12, "V12");
classVersions.put(Opcodes.V13, "V13");
classVersions.put(Opcodes.V14, "V14");
CLASS_VERSIONS = Collections.unmodifiableMap(classVersions);
}
......
......@@ -190,7 +190,7 @@ public class ClassReader {
this.b = classFileBuffer;
// Check the class' major_version. This field is after the magic and minor_version fields, which
// use 4 and 2 bytes respectively.
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V13) {
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V14) {
throw new IllegalArgumentException(
"Unsupported class file major version " + readShort(classFileOffset + 6));
}
......
......@@ -269,6 +269,7 @@ public interface Opcodes {
int V11 = 0 << 16 | 55;
int V12 = 0 << 16 | 56;
int V13 = 0 << 16 | 57;
int V14 = 0 << 16 | 58;
/**
* Version flag indicating that the class is using 'preview' features.
......
......@@ -190,6 +190,7 @@ public class ConstantsTest {
case "V11":
case "V12":
case "V13":
case "V14":
return ConstantType.CLASS_VERSION;
case "ACC_PUBLIC":
case "ACC_PRIVATE":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment