Commit ed9c4a6b authored by Andrey Loskutov's avatar Andrey Loskutov

Use latest ASM version to support Java 10+

parent 23edc025
eclipse.home=D:/work/eclipse-SDK-4.9/eclipse
\ No newline at end of file
......@@ -45,7 +45,7 @@ public class CommentedASMifierClassVisitor extends ASMifier implements ICommente
private final ClassNode classNode;
private CommentedASMifierClassVisitor(ClassNode classNode, final DecompilerOptions options, String name, int id) {
super(Opcodes.ASM6, name, id);
super(DecompilerOptions.LATEST_ASM_VERSION, name, id);
this.classNode = classNode;
this.options = options;
showLines = options.modes.get(BCOConstants.F_SHOW_LINE_INFO);
......@@ -320,7 +320,7 @@ public class CommentedASMifierClassVisitor extends ASMifier implements ICommente
private ASMifier getDummyVisitor(){
if (dummyAnnVisitor == null) {
dummyAnnVisitor = new ASMifier(Opcodes.ASM6, "", -1) {
dummyAnnVisitor = new ASMifier(DecompilerOptions.LATEST_ASM_VERSION, "", -1) {
@Override
public void visitAnnotationEnd() {
text.clear();
......
......@@ -44,7 +44,7 @@ public class CommentedClassVisitor extends Textifier implements ICommentedClassV
private int currentInsn;
public CommentedClassVisitor(ClassNode classNode, final DecompilerOptions options) {
super(Opcodes.ASM6);
super(DecompilerOptions.LATEST_ASM_VERSION);
this.classNode = classNode;
this.options = options;
raw = !options.modes.get(BCOConstants.F_SHOW_RAW_BYTECODE);
......@@ -573,7 +573,7 @@ public class CommentedClassVisitor extends Textifier implements ICommentedClassV
private Textifier getDummyVisitor(){
if (dummyAnnVisitor == null) {
dummyAnnVisitor = new Textifier(Opcodes.ASM6) {
dummyAnnVisitor = new Textifier(DecompilerOptions.LATEST_ASM_VERSION) {
@Override
public void visitAnnotationEnd() {
text.clear();
......
......@@ -13,7 +13,6 @@ import java.util.ArrayList;
import java.util.List;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.util.Printer;
import org.objectweb.asm.util.TraceClassVisitor;
......@@ -28,7 +27,7 @@ public class DecompilerHelper {
public static DecompiledClass getDecompiledClass(final byte[] bytes,
DecompilerOptions options) throws UnsupportedClassVersionError {
ClassReader cr = new ClassReader(bytes);
ClassNode cn = new ClassNode(Opcodes.ASM6);
ClassNode cn = new ClassNode(DecompilerOptions.LATEST_ASM_VERSION);
int crFlags = 0;
if(options.modes.get(BCOConstants.F_EXPAND_STACKMAP)) {
crFlags |= ClassReader.EXPAND_FRAMES;
......
......@@ -13,7 +13,7 @@ import org.objectweb.asm.Opcodes;
public class DecompilerOptions {
public static int LATEST_VERSION = Opcodes.ASM7_EXPERIMENTAL;
public static int LATEST_ASM_VERSION = Opcodes.ASM7_EXPERIMENTAL;
public final String fieldFilter;
public final String methodFilter;
......
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