Commit ff563afa authored by Andrey Loskutov's avatar Andrey Loskutov

Adopted to latest SimpleVerifier API changes

parent cba66a7c
......@@ -25,7 +25,9 @@ import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.analysis.Analyzer;
import org.objectweb.asm.tree.analysis.AnalyzerException;
import org.objectweb.asm.tree.analysis.BasicValue;
import org.objectweb.asm.tree.analysis.BasicVerifier;
import org.objectweb.asm.tree.analysis.Frame;
import org.objectweb.asm.tree.analysis.Interpreter;
import org.objectweb.asm.tree.analysis.SimpleVerifier;
import org.objectweb.asm.tree.analysis.Value;
......@@ -182,21 +184,19 @@ public class DecompiledMethod {
}
private void analyzeMethod(final ClassLoader cl) {
Analyzer<BasicValue> a = new Analyzer<BasicValue>(new SimpleVerifier() {
@Override
protected Class getClass(final Type t) {
try {
if (t.getSort() == Type.ARRAY) {
return Class.forName(t.getDescriptor().replace(
'/', '.'), true, cl);
}
return cl.loadClass(t.getClassName());
} catch (ClassNotFoundException e) {
throw new RuntimeException(e.toString()+" " +cl, e);
}
}
});
Interpreter<BasicValue> interpreter;
try {
Type type = Type.getType(owner);
interpreter = new SimpleVerifier(
DecompilerOptions.LATEST_ASM_VERSION, type, null,
null, false) {
//
};
} catch (Exception e) {
interpreter = new BasicVerifier();
}
Analyzer<BasicValue> a = new Analyzer<BasicValue>(interpreter);
try {
a.analyze(owner, meth);
} catch (AnalyzerException e) {
......@@ -592,6 +592,10 @@ public class DecompiledMethod {
if("." == s){
return arraySymbols + s;
}
// XXX Unresolved type
if("R" == s){
return arraySymbols + s;
}
// resolve primitive types
return arraySymbols +
CommentedClassVisitor.getSimpleName(Type.getType(s));
......
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