Issue #172 checkPrecoNextParts fix

This commit is contained in:
Jindra Petk
2013-07-04 22:03:34 +02:00
parent 8db15debbd
commit 45a08c4cbb
2 changed files with 5 additions and 2 deletions

View File

@@ -129,7 +129,7 @@ public class ActionGraph extends Graph {
protected List<GraphPart> checkPrecoNextParts(GraphPart part) {
List<GraphSourceItem> items = getPartItems(part);
part = makeMultiPart(part);
if (!items.isEmpty()) {
if (items.size() > 1) {
if (items.get(items.size() - 1) instanceof ActionIf) {
if (items.get(items.size() - 2) instanceof ActionStrictEquals) {
List<Integer> storeRegisters = new ArrayList<>();

View File

@@ -2311,7 +2311,10 @@ public class Graph {
}
} while (part != null);
if (parts.size() > 1) {
return new GraphPartMulti(parts);
GraphPartMulti ret = new GraphPartMulti(parts);
ret.refs.addAll(parts.get(0).refs);
ret.nextParts.addAll(parts.get(parts.size() - 1).nextParts);
return ret;
} else {
return parts.get(0);
}