Fixed: #2473, #2530 Always-break loops containing breaks (forward gotos)

This commit is contained in:
Jindra Petřík
2026-01-25 12:49:05 +01:00
parent 8397d32772
commit 281b35f3bf
22 changed files with 686 additions and 332 deletions

Binary file not shown.

View File

@@ -1,4 +1,4 @@
<DOMDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ns.adobe.com/xfl/2008/" currentTimeline="1" xflVersion="2.2" creatorInfo="Adobe Flash Professional CS6" platform="Windows" versionInfo="Saved by Adobe Flash Windows 12.0 build 481" majorVersion="12" buildNumber="481" nextSceneIdentifier="45" playOptionsPlayLoop="false" playOptionsPlayPages="false" playOptionsPlayFrameActions="false" autoSaveEnabled="true" autoSaveHasPrompted="true">
<DOMDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ns.adobe.com/xfl/2008/" currentTimeline="1" xflVersion="2.2" creatorInfo="Adobe Flash Professional CS6" platform="Windows" versionInfo="Saved by Adobe Flash Windows 12.0 build 481" majorVersion="12" buildNumber="481" nextSceneIdentifier="48" playOptionsPlayLoop="false" playOptionsPlayPages="false" playOptionsPlayFrameActions="false" autoSaveEnabled="true" autoSaveHasPrompted="true">
<media>
<DOMSoundItem name="Banana_Slap-AngryFlash-2001109808.wav" itemID="56b4f524-00000204" sourceExternalFilepath="./LIBRARY/Banana_Slap-AngryFlash-2001109808.wav" sourceLastImported="1454699803" externalFileCRC32="2782492837" externalFileSize="147466" href="Banana_Slap-AngryFlash-2001109808.wav" soundDataHRef="M 3 1454699812.dat" format="44kHz 16bit Stereo" sampleCount="36335"/>
<DOMBitmapItem name="Database-Delete-32.png" itemID="51a2751c-000001f8" sourceExternalFilepath="./LIBRARY/Database-Delete-32.png" sourceLastImported="1365451187" externalFileCRC32="828107249" externalFileSize="1713" useImportedJPEGData="false" compressionType="lossless" originalCompressionType="lossless" quality="50" href="Database-Delete-32.png" bitmapDataHRef="M 1 1369601308.dat" frameLeft="-115200" frameTop="-115200" frameRight="-115200" frameBottom="-115200"/>
@@ -31,7 +31,7 @@
<Include href="Tween 5.xml" itemIcon="1" loadImmediate="false" itemID="60429674-00000289" lastModified="1753122968"/>
</symbols>
<timelines>
<DOMTimeline name="Scene 1" currentFrame="76">
<DOMTimeline name="Scene 1" currentFrame="95">
<layers>
<DOMLayer name="Layer 17" color="#4FFF4F">
<frames>
@@ -771,9 +771,9 @@
</fills>
<edges>
<Edge fillStyle0="1" fillStyle1="2" edges="
!3050 7457[3050 7441 3159 7239!3159 7239[3270 7033 3327 6947!3327 6947[3353 6908 3412 6794!3412 6794[3470 6682 3500 6639!3500 6639[3602 6491 3649 6692!3649 6692|3713 6670!3713 6670[3760 6655 3782 6655!3782 6655[3942 6655 3985 6781!3985
6781[4007 6844 3996 6914!3996 6914[3996 6948 3999 6995!3999 6995[4000 7031 3993 7054!3993 7054[3976 7106 3860 7224!3860 7224[3847 7237 3741 7292!3741 7292[3638 7346 3616 7372!3616 7372[3594 7396 3511 7442!3511 7442[3435 7483 3427 7483
!3427 7483[3409 7483 3407 7468!3407 7468[3405 7453 3386 7453!3386 7453[3361 7468 3330 7483!3330 7483[3270 7512 3235 7512!3235 7512[3220 7512 3156 7501!3156 7501[3091 7490 3054 7490!3054 7490[3050 7494 3050 7457"/>
!3159 7239[3270 7033 3327 6947!3327 6947[3353 6908 3412 6794!3412 6794[3470 6682 3500 6639!3500 6639[3602 6491 3649 6692!3649 6692|3713 6670!3713 6670[3760 6655 3782 6655!3782 6655[3942 6655 3985 6781!3985 6781[4007 6844 3996 6914!3996
6914[3996 6948 3999 6995!3999 6995[4000 7031 3993 7054!3993 7054[3976 7106 3860 7224!3860 7224[3847 7237 3741 7292!3741 7292[3638 7346 3616 7372!3616 7372[3594 7396 3511 7442!3511 7442[3435 7483 3427 7483!3427 7483[3409 7483 3407 7468
!3407 7468[3405 7453 3386 7453!3386 7453[3361 7468 3330 7483!3330 7483[3270 7512 3235 7512!3235 7512[3220 7512 3156 7501!3156 7501[3091 7490 3054 7490!3054 7490[3050 7494 3050 7457!3050 7457[3050 7441 3159 7239"/>
<Edge fillStyle1="1" edges="
!2675 7305[2675 6953 2924 6704!2924 6704[3174 6454 3525 6454!3525 6454[3622 6454 3711 6474!3711 6474[3733 6454 3765 6434!3765 6434[3806 6409 3930 6340!3930 6340[4062 6261 4196 6152!4196 6152[4256 6104 4311 6071!4311 6071[4428 5999 4520
6000!4520 6000[4595 5999 4654 6049!4654 6049[4666 6059 4677 6071!4677 6071[4717 6116 4741 6186!4741 6186[4765 6256 4765 6315!4765 6315[4765 6361 4719 6443!4719 6443[4667 6534 4584 6614!4584 6614[4420 6774 4222 6815!4222 6815[4376 7028
@@ -3529,6 +3529,33 @@ function myFunction(item)
</Actionscript>
<elements/>
</DOMFrame>
<DOMFrame index="95" name="doWhileTwiceTest" labelType="name" keyMode="9728">
<Actionscript>
<script><![CDATA[trace("doWhileTwiceTest");
var a = 1;
var b = 2;
do {
do {
if (a) {
trace("x");
if (b) {
break;
}
trace("y");
}
trace("z");
}while(true);
trace("g");
if (b) {
break;
}
trace("h");
}while(true);
trace("finish");]]></script>
</Actionscript>
<elements/>
</DOMFrame>
</frames>
</DOMLayer>
</layers>
@@ -3536,6 +3563,7 @@ function myFunction(item)
</timelines>
<PrinterSettings/>
<publishHistory>
<PublishItem publishSize="109906" publishTime="1769340743"/>
<PublishItem publishSize="109817" publishTime="1768962510"/>
<PublishItem publishSize="109815" publishTime="1768962439"/>
<PublishItem publishSize="1157" publishTime="1768962336"/>
@@ -3555,6 +3583,5 @@ function myFunction(item)
<PublishItem publishSize="108927" publishTime="1729978944"/>
<PublishItem publishSize="108786" publishTime="1722543124"/>
<PublishItem publishSize="108700" publishTime="1722540660"/>
<PublishItem publishSize="108705" publishTime="1722540289"/>
</publishHistory>
</DOMDocument>

View File

@@ -37,24 +37,27 @@
</StrokeStyle>
</strokes>
<edges>
<Edge fillStyle0="1" fillStyle1="2" strokeStyle="1" edges="!7000 0|7000 1000!7000 1000|8000 1000"/>
<Edge fillStyle0="1" strokeStyle="1" edges="!8000 1000|8000 0"/>
<Edge fillStyle0="1" edges="!8000 0|7000 0"/>
<Edge fillStyle0="2" strokeStyle="1" edges="!7000 0|1000 0"/>
<Edge fillStyle0="4" edges="!1000 0|0 0"/>
<Edge fillStyle0="4" strokeStyle="1" edges="!0 0|0 1000"/>
<Edge fillStyle0="2" strokeStyle="1" edges="!0 1000|0 3000"/>
<Edge fillStyle0="5" strokeStyle="1" edges="!0 3000|0 4000!0 4000|1000 4000"/>
<Edge fillStyle0="5" fillStyle1="2" strokeStyle="1" edges="!1000 4000|1000 3000!1000 3000|0 3000"/>
<Edge fillStyle0="1" fillStyle1="2" strokeStyle="1" edges="!7000 0|7000 1000!7000 1000|8000 1000"/>
<Edge fillStyle0="3" fillStyle1="2" strokeStyle="1" edges="!8000 3000|7000 3000!7000 3000|7000 4000"/>
<Edge fillStyle0="3" strokeStyle="1" edges="!7000 4000|8000 4000!8000 4000|8000 3000"/>
<Edge fillStyle1="2" strokeStyle="1" edges="!7000 4000|1000 4000"/>
<Edge fillStyle0="5" fillStyle1="2" strokeStyle="1" edges="!1000 4000|1000 3000!1000 3000|0 3000"/>
<Edge fillStyle0="5" strokeStyle="1" edges="!0 3000|0 4000!0 4000|1000 4000"/>
<Edge fillStyle1="2" strokeStyle="1" edges="!8000 1000|8000 3000"/>
<Edge fillStyle1="3" strokeStyle="1" edges="!8000 3000|8000 4000!8000 4000|7000 4000"/>
<Edge fillStyle0="2" fillStyle1="6" strokeStyle="1" edges="!4000 3000[2757 3000 1878 2707!1878 2707[1000 2414 1000 2000!1000 2000[1000 1586 1878 1293!1878 1293[2757 1000 4000 1000!4000 1000[5243 1000 6121 1293!6121 1293[7000 1586 7000 2000!7000 2000[7000 2414 6121 2707!6121 2707[5243 3000 4000
3000"/>
<Edge fillStyle0="2" fillStyle1="4" strokeStyle="1" edges="
!1000 0|1000 1000!1000 1000|0 1000"/>
<Edge fillStyle1="2" strokeStyle="1" edges="
!7000 4000|1000 4000"/>
<Edge fillStyle0="2" strokeStyle="1" edges="
!0 1000|0 3000"/>
<Edge fillStyle0="4" strokeStyle="1" edges="
!0 0|0 1000"/>
<Edge fillStyle0="4" edges="
!1000 0|0 0"/>
<Edge fillStyle0="2" strokeStyle="1" edges="
!7000 0|1000 0"/>
</edges>
</DOMShape>
</elements>

View File

@@ -36,8 +36,8 @@ trace("init_blue");
</StrokeStyle>
</strokes>
<edges>
<Edge fillStyle1="1" strokeStyle="1" edges="!1262 253[1226 402 1321 562!1321 562[1336 582 1523 825!1523 825[1642 976 1647 1087!1647 1087[1654 1238 1475 1397!1475 1397[1351 1509 1091 1776!1091 1776[861 2014 767 2089!767 2089[619 2208 569 2155!569 2155[511 2092 568 1787!568 1787
|724 930!724 930[464 939 243 859!243 859[50 787 -57 669!-57 669[-160 555 -134 455!-134 455[-106 348 59 314!59 314[178 288 456 198!456 198[750 102 875 73!875 73[1331 -36 1262 253"/>
<Edge fillStyle1="1" strokeStyle="1" edges="!1321 562[1336 582 1523 825!1523 825[1642 976 1647 1087!1647 1087[1654 1238 1475 1397!1475 1397[1351 1509 1091 1776!1091 1776[861 2014 767 2089!767 2089[619 2208 569 2155!569 2155[511 2092 568 1787!568 1787|724 930!724 930[464 939 243
859!243 859[50 787 -57 669!-57 669[-160 555 -134 455!-134 455[-106 348 59 314!59 314[178 288 456 198!456 198[750 102 875 73!875 73[1331 -36 1262 253!1262 253[1226 402 1321 562"/>
<Edge cubics="!724 930(;-16,957 -399,411 59,314q724 930Q464 939q243 859Q50 787q-57 669Q-160 555q-134 455Q-106 348q59 314);"/>
<Edge cubics="!59 314(;518,215 1372,-211 1262,253q59 314Q178 288q456 198Q750 102q875 73Q1331 -36q1262 253);"/>
<Edge cubics="!1262 253(;1152,717 1996,929 1475,1397q1262 253Q1226 402q1321 562Q1336 582q1523 825Q1642 976q1647 1087Q1654 1238q1475 1397);"/>

View File

@@ -5,8 +5,8 @@
xmlns:xmp="http://ns.adobe.com/xap/1.0/">
<xmp:CreatorTool>Adobe Flash CS4 Professional</xmp:CreatorTool>
<xmp:CreateDate>2010-08-03T10:48:58+02:00</xmp:CreateDate>
<xmp:MetadataDate>2026-01-20T18:25:35-08:00</xmp:MetadataDate>
<xmp:ModifyDate>2026-01-20T18:25:35-08:00</xmp:ModifyDate>
<xmp:MetadataDate>2026-01-25T03:31:05-08:00</xmp:MetadataDate>
<xmp:ModifyDate>2026-01-25T03:31:05-08:00</xmp:ModifyDate>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:dc="http://purl.org/dc/elements/1.1/">
@@ -22,7 +22,7 @@
<stRef:originalDocumentID>xmp.did:8DD71700DC9EDF1194ADAC9B23608190</stRef:originalDocumentID>
</xmpMM:DerivedFrom>
<xmpMM:DocumentID>xmp.did:F0EB4FF7CAC3ED11AC9DC078F41E1AA7</xmpMM:DocumentID>
<xmpMM:InstanceID>xmp.iid:D83BD77770F6F01193CE8B873E4F6ED7</xmpMM:InstanceID>
<xmpMM:InstanceID>xmp.iid:54232456E1F9F01185C4F57BEF746DBF</xmpMM:InstanceID>
<xmpMM:OriginalDocumentID>xmp.did:8DD71700DC9EDF1194ADAC9B23608190</xmpMM:OriginalDocumentID>
<xmpMM:History>
<rdf:Seq>
@@ -512,6 +512,12 @@
<stEvt:when>2010-08-03T10:48:58+02:00</stEvt:when>
<stEvt:softwareAgent>Adobe Flash Professional CS6 - build 481</stEvt:softwareAgent>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<stEvt:action>created</stEvt:action>
<stEvt:instanceID>xmp.iid:54232456E1F9F01185C4F57BEF746DBF</stEvt:instanceID>
<stEvt:when>2010-08-03T10:48:58+02:00</stEvt:when>
<stEvt:softwareAgent>Adobe Flash Professional CS6 - build 481</stEvt:softwareAgent>
</rdf:li>
</rdf:Seq>
</xmpMM:History>
</rdf:Description>

View File

@@ -17,6 +17,7 @@ package
public class Main extends Sprite
{
TestActivationArguments;
TestAlwaysBreak;
TestAndOrCoercion;
TestArguments;
TestBitwiseOperands;
@@ -45,6 +46,7 @@ package
TestDoWhile2;
TestDoWhile3;
TestDoWhile4;
TestDoWhileTwice;
TestExecutionOrder;
TestExpressions;
TestFinallyZeroJump;

View File

@@ -0,0 +1,31 @@
package tests
{
public class TestAlwaysBreak
{
public function run():*
{
while(true)
{
var v = 5;
trace("a");
if(v > 4)
{
trace("b");
if(v > 10)
{
trace("c");
break; //standard "break", should lead to "f"
}
else
{
trace("d");
}
}
trace("e");
break; //"always break loop"
}
trace("f");
}
}
}

View File

@@ -0,0 +1,30 @@
package tests
{
public class TestDoWhileTwice
{
public function run():*
{
var a = 1;
var b = 2;
do {
do {
if (a) {
trace("x");
if (b) {
break;
}
trace("y");
}
trace("z");
}while(true);
trace("g");
if (b) {
break;
}
trace("h");
}while(true);
trace("finish");
}
}
}