Fixed: #2546 AS3 findProperty vs temporary registers

This commit is contained in:
Jindra Petřík
2025-10-25 17:19:12 +02:00
parent cf88dbde61
commit 0c109bc0eb
10 changed files with 185 additions and 2 deletions

View File

@@ -43,5 +43,6 @@ program
#include "tests/TestConstructDynamically.script.asasm"
#include "tests/TestCollidingPublicTraits.script.asasm"
#include "tests/TestSetGetLocalOnStack.script.asasm"
#include "tests/TestFindPropertyTemp.script.asasm"
; place to add next
end ; program

View File

@@ -0,0 +1,83 @@
class
refid "tests:TestFindPropertyTemp"
instance QName(PackageNamespace("tests"), "TestFindPropertyTemp")
extends QName(PackageNamespace(""), "Object")
flag SEALED
flag PROTECTEDNS
protectedns ProtectedNamespace("tests:TestFindPropertyTemp")
iinit
refid "tests:TestFindPropertyTemp/instance/init"
body
maxstack 1
localcount 1
initscopedepth 4
maxscopedepth 5
code
getlocal0
pushscope
getlocal0
constructsuper 0
returnvoid
end ; code
end ; body
end ; method
trait method QName(PackageNamespace(""), "run")
method
refid "tests:TestFindPropertyTemp/instance/run"
returns QName(PackageNamespace(""), "void")
body
maxstack 2
localcount 4
initscopedepth 4
maxscopedepth 5
code
getlocal0
pushscope
findproperty QName(PackageNamespace(""),"testA")
getlocal1
getproperty QName(PackageNamespace(""),"target")
dup
callpropvoid QName(PackageNamespace(""),"method"), 0
setproperty QName(PackageNamespace(""),"testA")
findproperty QName(PackageNamespace(""),"testB")
getlocal 9
getlocal2
getproperty MultinameL([PackageNamespace("")])
dup
pushstring "Str_"
swap
add
dup
findproperty MultinameL([PackageNamespace("")])
swap
getproperty MultinameL([PackageNamespace("")])
construct 0
getproperty QName(PackageNamespace(""),"sub")
callpropvoid QName(PackageNamespace(""),"testB"), 2
inclocal_i 2
returnvoid
end ; code
end ; body
end ; method
end ; trait
end ; instance
cinit
refid "tests:TestFindPropertyTemp/class/init"
body
maxstack 1
localcount 1
initscopedepth 3
maxscopedepth 4
code
getlocal0
pushscope
returnvoid
end ; code
end ; body
end ; method
end ; class

View File

@@ -0,0 +1,29 @@
script
sinit
refid "tests:TestFindPropertyTemp/init"
body
maxstack 2
localcount 1
initscopedepth 1
maxscopedepth 3
code
getlocal0
pushscope
findpropstrict Multiname("TestFindPropertyTemp", [PackageNamespace("tests")])
getlex QName(PackageNamespace(""), "Object")
pushscope
getlex Multiname("Object", [PrivateNamespace(null, "tests:TestFindPropertyTemp"), PackageNamespace(""), PackageNamespace("tests"), PackageInternalNs("tests"), Namespace("http://adobe.com/AS3/2006/builtin")])
newclass "tests:TestFindPropertyTemp"
popscope
initproperty QName(PackageNamespace("tests"), "TestFindPropertyTemp")
returnvoid
end ; code
end ; body
end ; method
trait class QName(PackageNamespace("tests"), "TestFindPropertyTemp")
#include "TestFindPropertyTemp.class.asasm"
end ; trait
end ; script