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

[release/9.0] Add missing Converts when simplifying in funcletizer (#35122) #35202

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

roji
Copy link
Member

@roji roji commented Nov 25, 2024

Fixes #35095
Port of #35122

Description
In 9.0, EF's funcletizer was rewritten for performance and NativeAOT support; this is the very first component that processes the incoming expression tree, extracting parameters and performing other important tasks. For certain query scenarios, e.g. Coalesce operations which can be optimized away, a missing conversion node can cause an exception.

Customer impact

LINQ queries such as the following, where a nullable value type parameter is coalesced in the query, but can be optimized away (since the parameter is known to be non-null), fail to translate in 9.0:

int? test = 1;
var blog = context.Blogs.Where(b => b.Id == (test ?? 0)).ToList();

As this querying scenario seems somewhat common, and the fix is very low-risk (add missing Convert node), it seems like this is a good candidate for servicing.

How found
Customer reported on 9.0.0

Regression
Yes, from 8.0.

Testing
Test added.

Risk
Low, quirk added.

@roji
Copy link
Member Author

roji commented Nov 26, 2024

Approved via email

@roji roji merged commit fa4ce99 into dotnet:release/9.0-staging Nov 26, 2024
7 checks passed
@roji roji deleted the FuncletizerConvert9 branch November 26, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants