Fixed: #2486 AS1/2 stoppart as end of function part

This commit is contained in:
Jindra Petřík
2025-07-18 19:55:12 +02:00
parent 3b3720ca87
commit 974c4fc6bd
2 changed files with 11 additions and 9 deletions

View File

@@ -3251,8 +3251,6 @@ public class Graph {
if (stopPartKind.get(i) == StopPartKind.BLOCK_CLOSE) {
if (stopPart.get(i) == part) {
isRealStopPart = true;
} else if (stopPart.get(i).start >= code.size()) { //end of as1/2 function
continue;
}
break;
}
@@ -3672,9 +3670,16 @@ public class Graph {
List<GraphPart> stopPart2 = new ArrayList<>(stopPart);
List<StopPartKind> stopPartKind2 = new ArrayList<>(stopPartKind);
if ((!isEmpty) && (next != null)) {
if (!isEmpty && next != null) {
//handle end of as1/2 script or function
if (next.start >= code.size()) {
next = null;
}
}
if ((!isEmpty) && (next != null)) {
stopPart2.add(next);
stopPartKind2.add(StopPartKind.BLOCK_CLOSE);
stopPartKind2.add(StopPartKind.BLOCK_CLOSE);
}
List<GraphTargetItem> onTrue = new ArrayList<>();