Commit d0afe0cd authored by Remi Forax's avatar Remi Forax
Browse files

Merge branch 'bump-version-support-to-12' into 'master'

Bump supported class version to V_12 (56)

See merge request asm/asm!187
parents 9a421251 c7308027
...@@ -80,6 +80,7 @@ public class ASMifier extends Printer { ...@@ -80,6 +80,7 @@ public class ASMifier extends Printer {
classVersions.put(Opcodes.V9, "V9"); classVersions.put(Opcodes.V9, "V9");
classVersions.put(Opcodes.V10, "V10"); classVersions.put(Opcodes.V10, "V10");
classVersions.put(Opcodes.V11, "V11"); classVersions.put(Opcodes.V11, "V11");
classVersions.put(Opcodes.V12, "V12");
CLASS_VERSIONS = Collections.unmodifiableMap(classVersions); CLASS_VERSIONS = Collections.unmodifiableMap(classVersions);
} }
......
...@@ -171,7 +171,7 @@ public class ClassReader { ...@@ -171,7 +171,7 @@ public class ClassReader {
this.b = classFileBuffer; this.b = classFileBuffer;
// Check the class' major_version. This field is after the magic and minor_version fields, which // Check the class' major_version. This field is after the magic and minor_version fields, which
// use 4 and 2 bytes respectively. // use 4 and 2 bytes respectively.
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V11) { if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V12) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"Unsupported class file major version " + readShort(classFileOffset + 6)); "Unsupported class file major version " + readShort(classFileOffset + 6));
} }
......
...@@ -69,6 +69,7 @@ public interface Opcodes { ...@@ -69,6 +69,7 @@ public interface Opcodes {
int V9 = 0 << 16 | 53; int V9 = 0 << 16 | 53;
int V10 = 0 << 16 | 54; int V10 = 0 << 16 | 54;
int V11 = 0 << 16 | 55; int V11 = 0 << 16 | 55;
int V12 = 0 << 16 | 56;
/** /**
* Version flag indicating that the class is using 'preview' features. * Version flag indicating that the class is using 'preview' features.
......
...@@ -79,6 +79,7 @@ public class ConstantsTest { ...@@ -79,6 +79,7 @@ public class ConstantsTest {
case "V9": case "V9":
case "V10": case "V10":
case "V11": case "V11":
case "V12":
assertFalse(classVersions.contains(field.getInt(null))); assertFalse(classVersions.contains(field.getInt(null)));
classVersions.add(field.getInt(null)); classVersions.add(field.getInt(null));
break; break;
......
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