mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-31 05:15:10 +00:00
while true fix
This commit is contained in:
@@ -917,7 +917,7 @@ public class Graph {
|
||||
}
|
||||
}
|
||||
|
||||
if (loop && (part.nextParts.size() > 1) && (!doWhile)) {
|
||||
if ((!whileTrue) && loop && (part.nextParts.size() > 1) && (!doWhile)) {
|
||||
currentLoop.loopBreak = part.nextParts.get(reversed ? 0 : 1);
|
||||
}
|
||||
|
||||
@@ -992,7 +992,12 @@ public class Graph {
|
||||
if (debugMode) {
|
||||
System.err.println("ONFALSE: (inside " + part + ")");
|
||||
}
|
||||
onFalse = (((next == part.nextParts.get(0)) || (part.nextParts.get(0).path.equals(part.path) || part.nextParts.get(0).path.length() < part.path.length())) ? new ArrayList<GraphTargetItem>() : printGraph(prepareBranchLocalData(localData), falseStack, allParts, part, part.nextParts.get(0), next == null ? stopPart : next, loops, forFinalCommands));
|
||||
if((next == part.nextParts.get(0)) || (part.nextParts.get(0).path.equals(part.path) || part.nextParts.get(0).path.length() < part.path.length()))
|
||||
{
|
||||
onFalse=new ArrayList<GraphTargetItem>();
|
||||
}else{
|
||||
onFalse = (printGraph(prepareBranchLocalData(localData), falseStack, allParts, part, part.nextParts.get(0), next == null ? stopPart : next, loops, forFinalCommands));
|
||||
}
|
||||
if (debugMode) {
|
||||
System.err.println("/ONFALSE (inside " + part + ")");
|
||||
}
|
||||
@@ -1004,7 +1009,15 @@ public class Graph {
|
||||
if (whileTrue) {
|
||||
retw = new ArrayList<GraphTargetItem>();
|
||||
retw.add(new IfItem(null, expr, onTrue, onFalse));
|
||||
|
||||
List<GraphTargetItem> body = new ArrayList<GraphTargetItem>();
|
||||
if(next!=null){
|
||||
body=printGraph(prepareBranchLocalData(localData), stack, allParts, part,next, stopPart, loops, forFinalCommands);
|
||||
}
|
||||
retw.addAll(body);
|
||||
|
||||
retx.add(new WhileItem(null, whileTrueLoop, new TrueItem(null), retw));
|
||||
next = null;
|
||||
} else {
|
||||
retx.add(new IfItem(null, expr, onTrue, onFalse));
|
||||
}
|
||||
@@ -1043,6 +1056,9 @@ public class Graph {
|
||||
if (doWhile) {
|
||||
loopBodyStart = next;
|
||||
}
|
||||
if(whileTrue){
|
||||
loopBodyStart = part;
|
||||
}
|
||||
}
|
||||
if (loop) { // && (!doWhile)) {
|
||||
List<GraphTargetItem> loopBody = new ArrayList<GraphTargetItem>();
|
||||
|
||||
Reference in New Issue
Block a user