summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStiver <stiver.mail@gmail.com>2014-06-01 15:34:28 +0200
committerStiver <stiver.mail@gmail.com>2014-06-01 15:34:28 +0200
commit7d44f73cb915fbee0efd6257ab8e78974ab52694 (patch)
tree9ad1d606a362cc2da6f0dead4a57be317493c0cc /src
parent7189d18bfe46bd5d9bcfc1c4c60b1438d0580e5b (diff)
downloadfernflower-7d44f73cb915fbee0efd6257ab8e78974ab52694.tar
fernflower-7d44f73cb915fbee0efd6257ab8e78974ab52694.tar.gz
fernflower-7d44f73cb915fbee0efd6257ab8e78974ab52694.tar.lz
fernflower-7d44f73cb915fbee0efd6257ab8e78974ab52694.tar.xz
fernflower-7d44f73cb915fbee0efd6257ab8e78974ab52694.zip
fixed IndexOutOfBoundsException when decompiling
StandardVariableNamesInspectionBase
Diffstat (limited to 'src')
-rw-r--r--src/de/fernflower/modules/decompiler/IdeaNotNullHelper.java1
-rw-r--r--src/de/fernflower/modules/decompiler/StackVarsProcessor.java2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/de/fernflower/modules/decompiler/IdeaNotNullHelper.java b/src/de/fernflower/modules/decompiler/IdeaNotNullHelper.java
index 98035d3..fe42f32 100644
--- a/src/de/fernflower/modules/decompiler/IdeaNotNullHelper.java
+++ b/src/de/fernflower/modules/decompiler/IdeaNotNullHelper.java
@@ -295,6 +295,7 @@ public class IdeaNotNullHelper {
}
sequence.getStats().removeWithKey(ifstat.id);
+ sequence.setFirst(sequence.getStats().get(0));
return true;
}
diff --git a/src/de/fernflower/modules/decompiler/StackVarsProcessor.java b/src/de/fernflower/modules/decompiler/StackVarsProcessor.java
index a76229f..e1f9218 100644
--- a/src/de/fernflower/modules/decompiler/StackVarsProcessor.java
+++ b/src/de/fernflower/modules/decompiler/StackVarsProcessor.java
@@ -229,7 +229,7 @@ public class StackVarsProcessor {
if(nd.statement.type == Statement.TYPE_DO) {
DoStatement loop = (DoStatement)nd.statement;
- if(nd.type == DirectNode.NODE_INCREMENT && loop.getLooptype() == DoStatement.LOOP_FOR) { // "downgrade" loop to 'while'
+ if(loop.getLooptype() == DoStatement.LOOP_FOR && loop.getInitExprent() == null && loop.getIncExprent() == null) { // "downgrade" loop to 'while'
loop.setLooptype(DoStatement.LOOP_WHILE);
}
}