AS3: Merged continues in try..catch

This commit is contained in:
Jindra Petřík
2021-02-07 13:19:37 +01:00
parent 45436d7232
commit 8637d16022
5 changed files with 6 additions and 9 deletions

View File

@@ -34,6 +34,7 @@ All notable changes to this project will be documented in this file.
- #349 AS3 - better handling of declarations
- #735 AS3 - index out of bounds in deobfuscator
- AS3 deobfuscator on &&, || operators
- Merged continues in try..catch
### Changed
- AS3 test methods separated to classes

View File

@@ -1173,7 +1173,9 @@ public class AVM2Graph extends Graph {
}
currentRet.add(tryItem);
/*processIfs(tryItem.tryCommands);
//----- Merge continues from catches/try BEGIN
processIfs(tryItem.tryCommands);
processIfs(tryItem.finallyCommands);
for (List<GraphTargetItem> cc : tryItem.catchCommands) {
processIfs(cc);
@@ -1236,7 +1238,8 @@ public class AVM2Graph extends Graph {
}
currentRet.add(maxCountCnt);
}
}*/
}
//----- Merge continues from catches/try END
if (afterPart != null) {

View File

@@ -233,12 +233,10 @@ public class ActionScript3AssembledDecompileTest extends ActionScript3DecompileT
+ "{\r\n"
+ "try\r\n"
+ "{\r\n"
+ "continue;\r\n"
+ "}\r\n"
+ "catch(e:Error)\r\n"
+ "{\r\n"
+ "trace(\"in catch\");\r\n"
+ "continue;\r\n"
+ "}\r\n"
+ "}\r\n"
+ "while(_loc5_ <= 100);\r\n"

View File

@@ -171,7 +171,6 @@ public class ActionScript3CrossCompileDecompileTest extends ActionScript3Decompi
+ "{\r\n"
+ "trace(\"in catch\");\r\n"
+ "a++;\r\n"
+ "continue;\r\n"
+ "}\r\n"
+ "}\r\n"
+ "return \"OK\";\r\n",
@@ -198,7 +197,6 @@ public class ActionScript3CrossCompileDecompileTest extends ActionScript3Decompi
+ "{\r\n"
+ "trace(\"in catch2\");\r\n"
+ "trace(\"a=\" + a);\r\n"
+ "continue;\r\n"
+ "}\r\n"
+ "}\r\n"
+ "trace(\"after\");\r\n",

View File

@@ -162,7 +162,6 @@ public class ActionScript3CrossCompileSwfToolsDecompileTest extends ActionScript
+ "{\r\n"
+ "trace(\"in catch\");\r\n"
+ "_loc1_++;\r\n"
+ "continue;\r\n"
+ "}\r\n"
+ "}\r\n"
+ "return \"OK\";\r\n",
@@ -189,7 +188,6 @@ public class ActionScript3CrossCompileSwfToolsDecompileTest extends ActionScript
+ "{\r\n"
+ "trace(\"in catch2\");\r\n"
+ "trace(\"a=\" + _loc1_);\r\n"
+ "continue;\r\n"
+ "}\r\n"
+ "}\r\n"
+ "trace(\"after\");\r\n",
@@ -264,7 +262,6 @@ public class ActionScript3CrossCompileSwfToolsDecompileTest extends ActionScript
+ "{\r\n"
+ "trace(\"in catch\");\r\n"
+ "trace(\"a=\" + _loc1_);\r\n"
+ "continue;\r\n"
+ "}\r\n"
+ "}\r\n"
+ "trace(\"after\");\r\n",