-
Notifications
You must be signed in to change notification settings - Fork 106
partially fix return in try; optimizer replaces JMP->ENDTRY with only ENDTRY #1283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Should this be solved in Neo VM? Evaluation stack should be cleared when invocation stack is popped with exception |
|
I think the VM should be responsible for clearing the evaluation stack when exception is thrown. http://lampwww.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/2010Q2/ExceptionHandling.pdf 1.4 Some rules about stack-emptiness
|
Great proposal. |
…to return-in-try # Conflicts: # tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Returns.cs
|
tightly strong leader! |
* master: fix: always check division overflow for int32 and int64 (#1287) Fix: some compiler warnings (#1288) use INC DEC (#1286) Update neo (#1285) Update: keep same sdk version with 'neo' (#1284) partially fix return in try; optimizer replaces JMP->ENDTRY with only ENDTRY (#1283) update to dotnet 9 (#1257) Added some styles (#1280) [`Fix`]: `checked(-x)` if x is int or long (#1281) Fix continue and goto (#1282) # Conflicts: # tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Types_BigInteger.cs
… ENDTRY (#1283) * partially fix return in try * optimizer replaces JMP-ENDTRY with only ENDTRY * Add { } --------- Co-authored-by: Shargon <[email protected]>
… ENDTRY (#1283) * partially fix return in try * optimizer replaces JMP-ENDTRY with only ENDTRY * Add { } --------- Co-authored-by: Shargon <[email protected]>
Fixed
returnin multiple layers of nestedtrycontext. Still a dangerous case is not solved. Commented in tests.throwis executed and nothing should be returned in this case, but the value ofais remained in the evaluation stack, without being handled by the external context.Also the assembly is not the most optimal. There is a JMP to an ENDTRY. The JMP is unnecessary.