summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStiver <stiver.mail@gmail.com>2014-08-13 22:06:28 +0200
committerStiver <stiver.mail@gmail.com>2014-08-13 22:06:28 +0200
commita2fa99e3a22f66317cfb4188f86ba5599f448891 (patch)
treecd9ed676a9b5be7268ff311958af3423d9177435
parent53ad2b920ec63b1d5900357e9d4725f74031daa9 (diff)
downloadfernflower-a2fa99e3a22f66317cfb4188f86ba5599f448891.tar
fernflower-a2fa99e3a22f66317cfb4188f86ba5599f448891.tar.gz
fernflower-a2fa99e3a22f66317cfb4188f86ba5599f448891.tar.lz
fernflower-a2fa99e3a22f66317cfb4188f86ba5599f448891.tar.xz
fernflower-a2fa99e3a22f66317cfb4188f86ba5599f448891.zip
Fixed 'IDEA-128591: Infinite loop ignored'
-rw-r--r--src/de/fernflower/modules/decompiler/DomHelper.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/de/fernflower/modules/decompiler/DomHelper.java b/src/de/fernflower/modules/decompiler/DomHelper.java
index 9377b30..7b3d46f 100644
--- a/src/de/fernflower/modules/decompiler/DomHelper.java
+++ b/src/de/fernflower/modules/decompiler/DomHelper.java
@@ -60,17 +60,17 @@ public class DomHelper {
stats.addWithKey(new BasicBlockStatement(block), block.id);
}
+ BasicBlock firstblock = graph.getFirst();
// head statement
- Statement firstst = stats.getWithKey(graph.getFirst().id);
+ Statement firstst = stats.getWithKey(firstblock.id);
// dummy exit statement
Statement dummyexit = new Statement();
dummyexit.type = Statement.TYPE_DUMMYEXIT;
Statement general;
- if(stats.size() > 1) {
+ if(stats.size() > 1 || firstblock.isSuccessor(firstblock)) { // multiple basic blocks or an infinite loop of one block
general = new GeneralStatement(firstst, stats, null);
- } else {
- // special case: one basic block
+ } else { // one straightforward basic block
RootStatement root = new RootStatement(firstst, dummyexit);
firstst.addSuccessor(new StatEdge(StatEdge.TYPE_BREAK, firstst, dummyexit, root));