mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-05 18:34:45 +00:00
Fixed: #2270 AS3 decompilation - unnnecessary local registers assignments as part of expressions when using optimization like dup, setlocal N instead of setlocal N, getlocal N
This commit is contained in:
@@ -2715,6 +2715,18 @@ public class Graph {
|
||||
return printGraph(foundGotos, partCodes, partCodePos, visited, localData, stack, allParts, parent, part, stopPart, stopPartKind, loops, throwStates, null, staticOperation, path, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets if expression from stack.
|
||||
* Can be overriden for custom handling
|
||||
* @param localData Local data
|
||||
* @param stack Stack
|
||||
* @param output Output
|
||||
* @return Expression
|
||||
*/
|
||||
protected GraphTargetItem getIfExpression(BaseLocalData localData, TranslateStack stack, List<GraphTargetItem> output) {
|
||||
return stack.pop();
|
||||
}
|
||||
|
||||
/**
|
||||
* Walks graph parts and converts them to target items.
|
||||
*
|
||||
@@ -3254,7 +3266,7 @@ public class Graph {
|
||||
} //else
|
||||
GraphPart nextOnePart = null;
|
||||
if (getNextParts(localData, part).size() == 2 && !partIsSwitch(part)) {
|
||||
GraphTargetItem expr = stack.pop();
|
||||
GraphTargetItem expr = getIfExpression(localData, stack, currentRet);
|
||||
|
||||
if (nextOnePart == null) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user