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

Fix a couple of crashes I found when testing the migration on a corpus. #1002

Merged
merged 1 commit into from
Mar 1, 2021

Conversation

munificent
Copy link
Member

There are basically three issues here:

  • The debug library, which isn't part of the public API, could crash
    when logging a chunk that wasn't fully initialized. Turned
    NestingLevel from late back to nullable to fix this. This doesn't
    affect users.

  • The null safety migration introduced a crash when formatting blocks
    inside string interpolation (why would someone do that?!). To fix
    that, instead of returning null chunks, changed ChunkBuilder to
    return dummy chunks. They end up getting discarded anyway.

  • Cascaded index operators always crash. I need to investigate more, but
    I think this bug may exist in the previous version of dart_style,
    which is in the SDK. I'll look into that next.

There are basically three issues here:

- The debug library, which isn't part of the public API, could crash
  when logging a chunk that wasn't fully initialized. Turned
  NestingLevel from late back to nullable to fix this. This doesn't
  affect users.

- The null safety migration introduced a crash when formatting blocks
  inside string interpolation (why would someone do that?!). To fix
  that, instead of returning null chunks, changed ChunkBuilder to
  return dummy chunks. They end up getting discarded anyway.

- Cascaded index operators always crash. I need to investigate more, but
  I think this bug may exist in the previous version of dart_style,
  which is in the SDK. I'll look into that next.
@munificent
Copy link
Member Author

I think this bug may exist in the previous version of dart_style, which is in the SDK. I'll look into that next.

Phew. Good news: The stable SDK looks like it's fine. The null just flows through without causing any problems.

Copy link
Member

@stereotype441 stereotype441 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@munificent munificent merged commit a1d65dd into master Mar 1, 2021
@munificent munificent deleted the fix-crashes branch March 1, 2021 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants