mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 21:00:45 +00:00
Issue #275 removing returnvoid as last method statement
This commit is contained in:
@@ -74,6 +74,7 @@ import com.jpexs.decompiler.graph.Graph;
|
||||
import com.jpexs.decompiler.graph.GraphPart;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.model.ScriptEndItem;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
@@ -1345,6 +1346,20 @@ public class AVM2Code implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
int lastPos = list.size() - 1;
|
||||
if (lastPos < 0) {
|
||||
lastPos = 0;
|
||||
}
|
||||
if ((list.size() > lastPos) && (list.get(lastPos) instanceof ScriptEndItem)) {
|
||||
lastPos--;
|
||||
}
|
||||
if (lastPos < 0) {
|
||||
lastPos = 0;
|
||||
}
|
||||
if ((list.size() > lastPos) && (list.get(lastPos) instanceof ReturnVoidAVM2Item)) {
|
||||
list.remove(lastPos);
|
||||
}
|
||||
|
||||
s = Graph.graphToString(list, constants, localRegNames, fullyQualifiedNames);
|
||||
if (!hilighted) {
|
||||
return Highlighting.stripHilights(s);
|
||||
|
||||
Reference in New Issue
Block a user