Fixed: #2322 More AS3 Assigment position when using dup

This commit is contained in:
Jindra Petřík
2024-09-25 10:02:35 +02:00
parent 7172ac5152
commit 4e8041c6f0
9 changed files with 103 additions and 35 deletions

View File

@@ -100,6 +100,7 @@ package
TestOperations;
TestOptimization;
TestOptimizationAndOr;
TestOptimizationWhile;
TestOptionalParameters;
TestParamNames;
TestParamsCount;

View File

@@ -0,0 +1,29 @@
package tests
{
public class TestOptimizationWhile
{
public function run():*
{
// Add more than 3 variables.
// Optimization happens from register 4 on.
// (setlocal X takes more bytes than dup)
var a:int = 1;
var b:int = 2;
var c:int = 3;
var d:int = 4;
while(true)
{
d = Math.round(Math.random() * 10);
if(d >= 10)
{
break;
}
trace("xxx");
d++;
}
}
}
}