Skip to content

Commit

Permalink
fixbug
Browse files Browse the repository at this point in the history
修正出现包外匿名函数时编译器崩溃的问题
  • Loading branch information
wuxiaoyu committed Dec 13, 2018
1 parent e546f4e commit 4c64f52
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 17 deletions.
5 changes: 4 additions & 1 deletion ASCR/compiler/CompileEnv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,10 @@ private void optimizeReg2()
}
else
{
dictCanNotOptimize.Add(register, null);
if (!dictCanNotOptimize.ContainsKey(register))
{
dictCanNotOptimize.Add(register, null);
}
//i--;
//break;
continue;
Expand Down
4 changes: 2 additions & 2 deletions ASCTest/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ static void Main(string[] args)
//path = @"F:\ASTool\ASCTest\testScript\AS3Testproj\src\";
//path = @"E:\Manju-pc\as3protobuf\AS3ProtoBuf\src";
//path = @"E:\Manju-pc\as3protobuf\AS3ProtoBuf\protobuflib";
//path = @"../..\testScript\AS3Testproj\amd";
path = @"../..\testScript\AS3Testproj\src";
path = @"../..\testScript\AS3Testproj\amd";
//path = @"../..\testScript\AS3Testproj\src";



Expand Down
Binary file modified ASCTest/bin/Release/as3protobuf.swc
Binary file not shown.
9 changes: 9 additions & 0 deletions ASCTest/testScript/AS3Testproj/amd/abc.as
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,12 @@ trace(f);
var f = new fib();
var ff = fib(f);
trace(ff);

var b = {};
b.a = function(i:int)
{
trace(i * i);

}

b.a(66);
11 changes: 5 additions & 6 deletions ASCTest/testScript/AS3Testproj/obj/AS3TestprojConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</define>
<define append="true">
<name>CONFIG::timeStamp</name>
<value>'2018/4/20'</value>
<value>'2018/12/13'</value>
</define>
<define append="true">
<name>CONFIG::air</name>
Expand All @@ -30,15 +30,14 @@
</define>
<verbose-stacktraces>true</verbose-stacktraces>
<source-path append="true">
<path-element>F:\ASTool\ASCTest\testScript\AS3Testproj\src</path-element>
<path-element>F:\ASTool\as3_commapi\api</path-element>
<path-element>F:\ASTool\as3_commapi\sharpapi</path-element>
<path-element>F:\ASTool\LinkCodeGenCLI\bin\Debug\as3api</path-element>
<path-element>F:\GitHub\apple-juice-actionscript\ASCTest\testScript\AS3Testproj\src</path-element>
<path-element>F:\GitHub\apple-juice-actionscript\as3_commapi\api</path-element>
<path-element>F:\GitHub\apple-juice-actionscript\as3_commapi\sharpapi</path-element>
<path-element>D:\Program Files (x86)\FlashDevelop\Library\AS3\classes</path-element>
</source-path>
</compiler>
<file-specs>
<path-element>F:\ASTool\ASCTest\testScript\AS3Testproj\src\Main.as</path-element>
<path-element>F:\GitHub\apple-juice-actionscript\ASCTest\testScript\AS3Testproj\src\Main.as</path-element>
</file-specs>
<default-background-color>#FFFFFF</default-background-color>
<default-frame-rate>30</default-frame-rate>
Expand Down
7 changes: 0 additions & 7 deletions ASCTest/testScript/AS3Testproj/src/Main.as
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,3 @@ package
}



interface iii
{
function log();
function log(i);

}
2 changes: 1 addition & 1 deletion ASTool/AS3FileGrammarAnalyser.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,7 @@ Public Class AS3FileGrammarAnalyser

Else
If func.IsAnonymous Then
If Not current_expression_canfunctioninvoke.Peek() And current_expression_canfunctioninvoke.Count < 3 Then
If current_expression_canfunctioninvoke.Count = 0 OrElse (Not current_expression_canfunctioninvoke.Peek() And current_expression_canfunctioninvoke.Count < 3) Then
Throw New GrammarException(node.MatchedToken, "'function' is not allowed here")
End If
End If
Expand Down
Binary file modified AutoGenCodeLib/bin/Debug/AutoGenCodeLib.dll
Binary file not shown.
Binary file modified AutoGenCodeLib/bin/Release/AutoGenCodeLib.dll
Binary file not shown.
Binary file modified AutoGenCodeLib/obj/Debug/AutoGenCodeLib.dll
Binary file not shown.
Binary file modified AutoGenCodeLib/obj/Release/AutoGenCodeLib.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ E:\ASTool\AutoGenCodeLib\bin\Release\AutoGenCodeLib.dll
E:\ASTool\AutoGenCodeLib\bin\Release\AutoGenCodeLib.pdb
E:\ASTool\AutoGenCodeLib\obj\Release\AutoGenCodeLib.dll
E:\ASTool\AutoGenCodeLib\obj\Release\AutoGenCodeLib.pdb
F:\GitHub\apple-juice-actionscript\AutoGenCodeLib\bin\Release\AutoGenCodeLib.dll
F:\GitHub\apple-juice-actionscript\AutoGenCodeLib\bin\Release\AutoGenCodeLib.pdb
F:\GitHub\apple-juice-actionscript\AutoGenCodeLib\obj\Release\AutoGenCodeTestLib.csprojAssemblyReference.cache
F:\GitHub\apple-juice-actionscript\AutoGenCodeLib\obj\Release\AutoGenCodeTestLib.csproj.CoreCompileInputs.cache
F:\GitHub\apple-juice-actionscript\AutoGenCodeLib\obj\Release\AutoGenCodeLib.dll
F:\GitHub\apple-juice-actionscript\AutoGenCodeLib\obj\Release\AutoGenCodeLib.pdb
Binary file modified BuildOutSDK/1.0.0/linkcodegencli/ASCompiler.dll
Binary file not shown.
Binary file modified BuildOutSDK/1.0.0/linkcodegencli/ASTool.dll
Binary file not shown.
Binary file modified BuildOutSDK/1.0.0/linkcodegencli/LinkCodeGenCLI.exe
Binary file not shown.

0 comments on commit 4c64f52

Please sign in to comment.