Fixed: Try..catch.finally vs loops

This commit is contained in:
Jindra Petřík
2021-02-02 09:42:38 +01:00
parent 8878940754
commit f6744eafb9
20 changed files with 866 additions and 171 deletions

View File

@@ -12,7 +12,8 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
* License along with this library.
*/
package com.jpexs.decompiler.graph;
import com.jpexs.decompiler.flash.BaseLocalData;
@@ -123,7 +124,7 @@ public class GraphPart implements Serializable {
return time;
}
private boolean leadsTo(BaseLocalData localData, Graph gr, GraphSource code, GraphPart prev, GraphPart part, HashSet<GraphPart> visited, List<Loop> loops, boolean useThrow) throws InterruptedException {
if (Thread.currentThread().isInterrupted()) {
throw new InterruptedException();
}
@@ -133,7 +134,7 @@ public class GraphPart implements Serializable {
return false;
}
if (tpart != this) {
if (tpart != this) {
return tpart.leadsTo(localData, gr, code, null, part, visited, loops, useThrow);
}
Loop currentLoop = null;
for (Loop l : loops) {
@@ -170,25 +171,27 @@ public class GraphPart implements Serializable {
for (GraphPart p : nextParts) {
if (p == part) {
return true;
return true;
} else if (p.leadsTo(localData, gr, code, this, part, visited, loops, useThrow)) {
return true;
}
}
}
for (GraphPart p : throwParts) {
if (p == part) {
return true;
} else if (p.leadsTo(localData, gr, code, this, part, visited, loops)) {
if (useThrow) {
for (GraphPart p : throwParts) {
if (p == part) {
return true;
} else if (p.leadsTo(localData, gr, code, this, part, visited, loops, useThrow)) {
return true;
}
}
}
return false;
}
public boolean leadsTo(BaseLocalData localData, Graph gr, GraphSource code, GraphPart part, List<Loop> loops, boolean useThrow) throws InterruptedException {
for (Loop l : loops) {
l.leadsToMark = 0;
}
}
return leadsTo(localData, gr, code, null /*???*/, part, new HashSet<>(), loops, useThrow);
}
public GraphPart(int start, int end) {