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

[CP] Fix crashes due to unhandled StructuralParameterTypes in UP in the CFE #56439

Closed
chloestefantsova opened this issue Aug 12, 2024 · 6 comments
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. cherry-pick-review Issue that need cherry pick triage to approve type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@chloestefantsova
Copy link
Contributor

Commit(s) to merge

https://dart-review.googlesource.com/c/sdk/+/379800

Target

beta

Prepared changelist for beta/stable

https://dart-review.googlesource.com/c/sdk/+/380001

Issue Description

The algorithm for computing the standard upper bound of two types, also known as UP, was partially missing its implementation for StructuralParameterType objects. In some corner casing the lacking implementation resulted in a crash of the compiler. All platforms using the CFE were affected.

What is the fix

The fix adds the missing part of the UP algorithm.

Why cherry-pick

The crashes due to the lacking implementation of UP in the CFE were reported by Flutter users: flutter/flutter#152984.

Risk

Low. The update is local and minimal and passes our CQ tests. Moreover, the missing part of the algorithm is implemented via abstracting a similar part of the same algorithm for TypeParameterType objects and applying it to StructuralParameterType objects.

Issue link(s)

flutter/flutter#152984

Extra Info

No response

@chloestefantsova chloestefantsova added the cherry-pick-review Issue that need cherry pick triage to approve label Aug 12, 2024
@dart-github-bot
Copy link
Collaborator

Summary: The Dart compiler (CFE) crashed in certain scenarios due to an incomplete implementation of the "upper bound" algorithm for StructuralParameterType objects. The fix completes the algorithm, preventing crashes and ensuring proper type inference.

@dart-github-bot dart-github-bot added area-front-end Use area-front-end for front end / CFE / kernel format related issues. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Aug 12, 2024
@itsjustkevin
Copy link
Contributor

@chloestefantsova is this meant for stable? This will land in the next Dart beta branch coming soon, we won’t need to cherry-pick to beta.

@chloestefantsova
Copy link
Contributor Author

@itsjustkevin I'm not entirely sure. @mraleph requested a CP, and @johnniwinther suggested it should be in beta. I'm happy to recreate the request for stable if needed.

@itsjustkevin
Copy link
Contributor

@mraleph and @johnniwinther i plan to do a beta build this week which will include the fix that landed on main. Does this satisfy the requirements?

@lrhn lrhn removed the triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. label Aug 12, 2024
@johnniwinther
Copy link
Member

Move it to stable. It's satisfactory to have it in the next beta.

@chloestefantsova
Copy link
Contributor Author

Following the discussion above, I'm closing this request. I've created the CP for stable instead: #56457.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. cherry-pick-review Issue that need cherry pick triage to approve type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

8 participants