Commit 131d118f authored by Remi Forax's avatar Remi Forax
Browse files

recognize Java 10 version (64)

parent bc2420aa
Pipeline #21581 passed with stage
in 6 minutes and 30 seconds
......@@ -109,6 +109,7 @@ public class ASMifier extends Printer {
classVersions.put(Opcodes.V17, "V17");
classVersions.put(Opcodes.V18, "V18");
classVersions.put(Opcodes.V19, "V19");
classVersions.put(Opcodes.V20, "V20");
CLASS_VERSIONS = Collections.unmodifiableMap(classVersions);
}
......
......@@ -194,7 +194,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.V19) {
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V20) {
throw new IllegalArgumentException(
"Unsupported class file major version " + readShort(classFileOffset + 6));
}
......
......@@ -285,6 +285,7 @@ public interface Opcodes {
int V17 = 0 << 16 | 61;
int V18 = 0 << 16 | 62;
int V19 = 0 << 16 | 63;
int V20 = 0 << 16 | 64;
/**
* Version flag indicating that the class is using 'preview' features.
......
......@@ -252,6 +252,7 @@ class ConstantsTest {
case "V17":
case "V18":
case "V19":
case "V20":
return ConstantType.CLASS_VERSION;
case "ACC_PUBLIC":
case "ACC_PRIVATE":
......
Supports Markdown
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