Skip to content

Commit e231a38

Browse files
committed
Fix test4
1 parent 96f44a6 commit e231a38

File tree

2 files changed

+25
-28
lines changed

2 files changed

+25
-28
lines changed

src/org/jetbrains/java/decompiler/modules/decompiler/LabelHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public static void lowContinueLabels(Statement stat, HashSet<StatEdge> edges) {
108108
if (!ok) {
109109
DoStatement dostat = (DoStatement)stat;
110110
ok = dostat.getLooptype() == DoStatement.Type.INFINITE ||
111-
dostat.getLooptype() == DoStatement.Type.WHILE ||
111+
dostat.getLooptype() == DoStatement.Type.WHILE && dostat.getConditionExprent() == null ||
112112
(dostat.getLooptype() == DoStatement.Type.FOR && dostat.getIncExprent() == null);
113113
}
114114

testData/results/pkg/TestDoWhileMerge.dec

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ public class TestDoWhileMerge {
6262

6363
public void test4() {
6464
while (1.0 > Math.random()) {// 69
65-
System.out.println();// 71
66-
System.out.println();// 72
67-
if (!(1.0 < Math.random())) {// 73
68-
}
65+
do {
66+
System.out.println();// 71
67+
System.out.println();// 72
68+
} while (1.0 < Math.random());// 73
6969
}
7070
}// 75
7171
}
@@ -271,26 +271,23 @@ class 'pkg/TestDoWhileMerge' {
271271
5 63
272272
6 63
273273
7 63
274-
8 64
275-
9 64
276-
a 64
277-
b 64
278-
c 64
279-
d 64
280-
e 65
281-
f 65
282-
10 65
283-
11 65
284-
12 65
285-
13 65
286-
14 66
287-
15 66
288-
16 66
289-
17 66
290-
18 66
291-
19 66
292-
1a 66
293-
1b 66
274+
8 65
275+
9 65
276+
a 65
277+
b 65
278+
c 65
279+
d 65
280+
e 66
281+
f 66
282+
10 66
283+
11 66
284+
12 66
285+
13 66
286+
14 67
287+
15 67
288+
16 67
289+
17 67
290+
18 67
294291
1f 69
295292
}
296293
}
@@ -328,9 +325,9 @@ Lines mapping:
328325
64 <-> 59
329326
66 <-> 61
330327
69 <-> 64
331-
71 <-> 65
332-
72 <-> 66
333-
73 <-> 67
328+
71 <-> 66
329+
72 <-> 67
330+
73 <-> 68
334331
75 <-> 70
335332
Not mapped:
336333
51

0 commit comments

Comments
 (0)