-
Notifications
You must be signed in to change notification settings - Fork 1.7k
VM crash on "await x++". #22634
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
Comments
cc @crelier. |
This comment was originally written by @mhausner The VM clearly should not crash. What does await x++ mean? is it the same as x++; await x? |
await x++ |
Adding Gilad for the interpretation of the language spec. Thanks! cc @gbracha. |
It is the same as await (x++); await ( (){var r = v; v= r + 1; return r;}() ); |
It no longer crashes, but it fails to work. The code ERROR: await expression unary postfix operator |
This comment was originally written by @mhausner Nothing has changed for me. I still get the same assertion error. It's not an easy fix. The problem are LetNode ast nodes, which in at least two ways do not fit well into the ast transformation we do for await. |
ACK, I was running a non-debug build, hence the missing C++ assertion. |
Example code:
main() async {
var x = 0;
await x++;
}
yields:
runtime/vm/scopes.h:62: error: expected: HasIndex()
Aborted (core dumped)
The text was updated successfully, but these errors were encountered: