mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 15:20:48 +00:00
pcode export: static constructor missing problem fixed
This commit is contained in:
@@ -70,7 +70,7 @@ public class NewFunctionAVM2Item extends AVM2Item {
|
||||
writer.append("{").newLine();
|
||||
if (body != null) {
|
||||
if (writer instanceof NulWriter) {
|
||||
body.convert(path + "/inner", ExportMode.SOURCE, isStatic, scriptIndex, classIndex, abc, null, constants, methodInfo, new Stack<GraphTargetItem>()/*scopeStack*/, false, fullyQualifiedNames, null, false);
|
||||
body.convert(path + "/inner", ExportMode.SOURCE, isStatic, scriptIndex, classIndex, abc, null, constants, methodInfo, new Stack<GraphTargetItem>()/*scopeStack*/, false, writer, fullyQualifiedNames, null, false);
|
||||
} else {
|
||||
body.toString(path + "/inner", ExportMode.SOURCE, isStatic, scriptIndex, classIndex, abc, null, constants, methodInfo, new Stack<GraphTargetItem>()/*scopeStack*/, false, writer, fullyQualifiedNames, null);
|
||||
}
|
||||
|
||||
@@ -115,18 +115,17 @@ public class MethodBody implements Cloneable, Serializable {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public HilightedTextWriter toString(final String path, ExportMode exportMode, final boolean isStatic, final int scriptIndex, final int classIndex, final ABC abc, final Trait trait, final ConstantPool constants, final MethodInfo[] method_info, final Stack<GraphTargetItem> scopeStack, final boolean isStaticInitializer, final List<String> fullyQualifiedNames, final Traits initTraits) throws InterruptedException {
|
||||
convert(path, exportMode, isStatic, scriptIndex, classIndex, abc, trait, constants, method_info, scopeStack, isStaticInitializer, fullyQualifiedNames, initTraits, true);
|
||||
HilightedTextWriter writer = new HilightedTextWriter(false);
|
||||
toString(path, exportMode, isStatic, scriptIndex, classIndex, abc, trait, constants, method_info, scopeStack, isStaticInitializer, writer, fullyQualifiedNames, initTraits);
|
||||
return writer;
|
||||
}
|
||||
|
||||
public void convert(final String path, ExportMode exportMode, final boolean isStatic, final int scriptIndex, final int classIndex, final ABC abc, final Trait trait, final ConstantPool constants, final MethodInfo[] method_info, final Stack<GraphTargetItem> scopeStack, final boolean isStaticInitializer, final List<String> fullyQualifiedNames, final Traits initTraits, boolean firstLevel) throws InterruptedException {
|
||||
public void convert(final String path, ExportMode exportMode, final boolean isStatic, final int scriptIndex, final int classIndex, final ABC abc, final Trait trait, final ConstantPool constants, final MethodInfo[] method_info, final Stack<GraphTargetItem> scopeStack, final boolean isStaticInitializer, final GraphTextWriter writer, final List<String> fullyQualifiedNames, final Traits initTraits, boolean firstLevel) throws InterruptedException {
|
||||
if (debugMode) {
|
||||
System.err.println("Decompiling " + path);
|
||||
}
|
||||
if (exportMode == ExportMode.SOURCE) {
|
||||
if (exportMode != ExportMode.SOURCE) {
|
||||
code.toASMSource(constants, trait, method_info[this.method_info], this, exportMode, writer);
|
||||
} else {
|
||||
if (!Configuration.decompile.get()) {
|
||||
writer.appendNoHilight("//Decompilation skipped").newLine();
|
||||
return;
|
||||
}
|
||||
int timeout = Configuration.decompilationTimeoutSingleMethod.get();
|
||||
try {
|
||||
Callable<Void> callable = new Callable<Void>() {
|
||||
@@ -135,7 +134,7 @@ public class MethodBody implements Cloneable, Serializable {
|
||||
MethodBody converted = convertMethodBody(path, isStatic, scriptIndex, classIndex, abc, trait, constants, method_info, scopeStack, isStaticInitializer, fullyQualifiedNames, initTraits);
|
||||
HashMap<Integer, String> localRegNames = getLocalRegNames(abc);
|
||||
convertedItems = converted.code.toGraphTargetItems(path, isStatic, scriptIndex, classIndex, abc, constants, method_info, converted, localRegNames, scopeStack, isStaticInitializer, fullyQualifiedNames, initTraits, Graph.SOP_USE_STATIC, new HashMap<Integer, Integer>(), converted.code.visitCode(converted));
|
||||
Graph.graphToString(convertedItems, new NulWriter(), LocalData.create(constants, localRegNames, fullyQualifiedNames));
|
||||
Graph.graphToString(convertedItems, writer, LocalData.create(constants, localRegNames, fullyQualifiedNames));
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@@ -165,7 +164,7 @@ public class MethodBody implements Cloneable, Serializable {
|
||||
if (!Configuration.decompile.get()) {
|
||||
writer.indent();
|
||||
writer.startMethod(this.method_info);
|
||||
writer.appendNoHilight("//Decompilation skipped");
|
||||
writer.appendNoHilight("//Decompilation skipped").newLine();
|
||||
writer.endMethod();
|
||||
writer.unindent();
|
||||
return writer;
|
||||
|
||||
@@ -505,7 +505,7 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
int bodyIndex = abc.findBodyIndex(abc.class_info[class_info].cinit_index);
|
||||
if (bodyIndex != -1) {
|
||||
writer.mark();
|
||||
abc.bodies[bodyIndex].convert(path +/*packageName +*/ "/" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames) + ".staticinitializer", exportMode, true, scriptIndex, class_info, abc, this, abc.constants, abc.method_info, new Stack<GraphTargetItem>(), true, fullyQualifiedNames, abc.class_info[class_info].static_traits, true);
|
||||
abc.bodies[bodyIndex].convert(path +/*packageName +*/ "/" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames) + ".staticinitializer", exportMode, true, scriptIndex, class_info, abc, this, abc.constants, abc.method_info, new Stack<GraphTargetItem>(), true, writer, fullyQualifiedNames, abc.class_info[class_info].static_traits, true);
|
||||
classInitializerIsEmpty = !writer.getMark();
|
||||
}
|
||||
|
||||
@@ -513,7 +513,7 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
if (!abc.instance_info[class_info].isInterface()) {
|
||||
bodyIndex = abc.findBodyIndex(abc.instance_info[class_info].iinit_index);
|
||||
if (bodyIndex != -1) {
|
||||
abc.bodies[bodyIndex].convert(path +/*packageName +*/ "/" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames) + ".initializer", exportMode, false, scriptIndex, class_info, abc, this, abc.constants, abc.method_info, new Stack<GraphTargetItem>(), false, fullyQualifiedNames, abc.instance_info[class_info].instance_traits, true);
|
||||
abc.bodies[bodyIndex].convert(path +/*packageName +*/ "/" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames) + ".initializer", exportMode, false, scriptIndex, class_info, abc, this, abc.constants, abc.method_info, new Stack<GraphTargetItem>(), false, writer, fullyQualifiedNames, abc.instance_info[class_info].instance_traits, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ public class TraitFunction extends Trait implements TraitWithSlot {
|
||||
if (!abc.instance_info[classIndex].isInterface()) {
|
||||
int bodyIndex = abc.findBodyIndex(method_info);
|
||||
if (bodyIndex != -1) {
|
||||
abc.bodies[bodyIndex].convert(path + "." + abc.constants.getMultiname(name_index).getName(abc.constants, fullyQualifiedNames), exportMode, isStatic, scriptIndex, classIndex, abc, this, abc.constants, abc.method_info, new Stack<GraphTargetItem>(), false, fullyQualifiedNames, null, true);
|
||||
abc.bodies[bodyIndex].convert(path + "." + abc.constants.getMultiname(name_index).getName(abc.constants, fullyQualifiedNames), exportMode, isStatic, scriptIndex, classIndex, abc, this, abc.constants, abc.method_info, new Stack<GraphTargetItem>(), false, writer, fullyQualifiedNames, null, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class TraitMethodGetterSetter extends Trait {
|
||||
int bodyIndex = abc.findBodyIndex(method_info);
|
||||
if (!(classIndex != -1 && abc.instance_info[classIndex].isInterface() || bodyIndex == -1)) {
|
||||
if (bodyIndex != -1) {
|
||||
abc.bodies[bodyIndex].convert(path, exportMode, isStatic, scriptIndex, classIndex, abc, this, abc.constants, abc.method_info, new Stack<GraphTargetItem>(), false, fullyQualifiedNames, null, true);
|
||||
abc.bodies[bodyIndex].convert(path, exportMode, isStatic, scriptIndex, classIndex, abc, this, abc.constants, abc.method_info, new Stack<GraphTargetItem>(), false, writer, fullyQualifiedNames, null, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user