Files
jpexs-decompiler/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/BasicPrevNextWalker.java
Jindra Petřík 7d18834c81 feat!: redesigned loop detector (#2542)
Instead of walking code structures to get loops,
the loops are populated by new faster algorithm.
Also, we do not join adjacent GraphParts anymore
in non-obfuscated code.
For proper switch handling, the code is decompiled
in two passes everytime (Previously, the second pass
was used only sometimes).
In first pass we do not process ifs as it may break
switch detection. Second pass is executed after we know
the switches position.

Fixes #2542
2026-04-06 21:06:19 +02:00

38 lines
1.1 KiB
Java

/*
* Copyright (C) 2018 JPEXS, All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
package com.jpexs.decompiler.graph;
import java.util.List;
/**
* Basic Prev-Next walker which uses only nextParts+refs.
* @author JPEXS
*/
public class BasicPrevNextWalker implements PrevNextWalker {
@Override
public List<? extends GraphPart> getPrev(GraphPart node) {
return node.refs;
}
@Override
public List<? extends GraphPart> getNext(GraphPart node) {
return node.nextParts;
}
}