Skip to content
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

Suspicious code is added to UnboundLambda.WithNullableState function #41290

Open
AlekseyTs opened this issue Jan 29, 2020 · 0 comments
Open

Suspicious code is added to UnboundLambda.WithNullableState function #41290

AlekseyTs opened this issue Jan 29, 2020 · 0 comments

Comments

@AlekseyTs
Copy link
Contributor

Suspicious code is added to UnboundLambda.WithNullableState function here https://github.com/dotnet/roslyn/pull/40534/files#diff-b4c0d0abc290a3696848da779340f860R351:

        internal UnboundLambda WithNullableState(Binder binder, NullableWalker.VariableState nullableState)
        {
            var data = Data.WithCaching(true);
            var lambda = new UnboundLambda(Syntax, data, nullableState, HasErrors);
            data.SetUnboundLambda(lambda);
            return lambda;
        }

It looks like the data.SetUnboundLambda(lambda); line can change parent for an existing UnboundLambdaState instance, and the instance will be shared between two UnboundLambda instances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant