Skip to content

[CP] Fix infinite loop in DDC compiler #52869

@nshahan

Description

@nshahan

Commit(s) to merge

be6a560

Target

stable and beta

Prepared changelist for stable/beta

Stable: https://dart-review.googlesource.com/c/sdk/+/312709,
Beta: https://dart-review.googlesource.com/c/sdk/+/312710

Issue Description

Some web development compiles of libraries containing is or as with specific record types will hang and never complete.

A minimal reproduction:

main() {
  Object value = 'x';
  (a: 'a', b: value) as ({String a, String b});
}

What is the fix

Some record type comparison operations were not properly incrementing a loop variable when iterating the named elements. With this fix the execution can properly exit the loop and the compile succeeds.

Why cherry-pick

Some type operations using record types will cause the DDC to hang while compiling preventing use of either the record types or web development compiler.

A user reported hitting this in a flutter application and could not compile their app for web development.

Risk

low

Issue link(s)

#52817, flutter/flutter#129482

Extra Info

cc @sigmundch

Metadata

Metadata

Labels

area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.cherry-pick-approvedLabel for approved cherrypick requestcherry-pick-reviewIssue that need cherry pick triage to approve

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions