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 #56457

Closed
chloestefantsova opened this issue Aug 13, 2024 · 1 comment
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. cherry-pick-approved Label for approved cherrypick request cherry-pick-merged Cherry-pick has been merged to the stable or beta branch. 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

stable

Prepared changelist for beta/stable

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

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

@dart-github-bot
Copy link
Collaborator

Summary: The Dart compiler (CFE) crashed in certain scenarios due to an incomplete implementation of the "upper bound" (UP) algorithm for StructuralParameterType objects. The fix completes the UP algorithm for these types, 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 13, 2024
copybara-service bot pushed a commit that referenced this issue Aug 13, 2024
Closes #56420

Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/379800
Cherry-pick-request: #56457
Change-Id: Ib82efe4cd0da9f406f87d2c23f77f3f2f86147ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380240
Reviewed-by: Johnni Winther <[email protected]>
Commit-Queue: Kevin Chisholm <[email protected]>
@itsjustkevin itsjustkevin added cherry-pick-approved Label for approved cherrypick request cherry-pick-merged Cherry-pick has been merged to the stable or beta branch. labels Aug 13, 2024
copybara-service bot pushed a commit that referenced this issue Aug 13, 2024
Fixes #56047


Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/376500
Cherry-pick-request: #56457
Change-Id: I3cb5ee316e4fe5564c0e5234d08566fec84de759
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380205
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Kevin Chisholm <[email protected]>
Reviewed-by: Phil Quitslund <[email protected]>
@lrhn lrhn removed the triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. label Aug 14, 2024
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-approved Label for approved cherrypick request cherry-pick-merged Cherry-pick has been merged to the stable or beta branch. 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

7 participants