-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Avoid deep recursion while emitting deeply nested logical conditions #66993
Conversation
@dotnet/roslyn-compiler Please review |
2 similar comments
@dotnet/roslyn-compiler Please review |
@dotnet/roslyn-compiler Please review |
cc @jaredpar |
// fallThrough: | ||
|
||
object fallThrough = null; | ||
var stack = ArrayBuilder<(BoundExpression? condition, StrongBox<object?> destBox, bool sense)>.GetInstance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is dest wrapped in a StrongBox
? Why not store just object?
in the stack? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is dest wrapped in a
StrongBox
? Why not store justobject?
in the stack?
Its value is mutable and is supposed to be shared between different items on the stack (including mutations). If we simply store object?
, we will store its current value (often null
) and won't be able to observe the changes. We need an indirection in order to be able share the mutations as well. StrongBox
gives us an indirection.
@dotnet/roslyn-compiler For the second review |
Fixes #66900.