-
Notifications
You must be signed in to change notification settings - Fork 4k
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
stackalloc expressions have limited syntax #22046
Labels
Milestone
Comments
OmarTawfik
added
Area-Compilers
New Language Feature - Readonly References
Readonly References
labels
Sep 11, 2017
5 tasks
This is tracked as a language issue at dotnet/csharplang#1412 |
This is relaxed (by spilling) in #28969 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Due to a CLR spec limitation, stackalloc instructions cannot be executed unless the evaluation stack is cleared of other items. This means that the following code will not be executed at run-time:
DoSomething(obj1, stackalloc int[10]);
For that to happen, we need to save (spill) all prior values on the evaluation stack to temps before executing this instruction. For now, in feature branch
freatures/readonly-ref
, the scope of this instruction is constricted to either (1) initialization statements or (2) ternary conditional operators.The text was updated successfully, but these errors were encountered: