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 Issue 21956 - ice on foreach over an AA of noreturn #14274

Merged
merged 1 commit into from Jul 12, 2022

Conversation

RazvanN7
Copy link
Contributor

@RazvanN7 RazvanN7 commented Jul 8, 2022

The backend does not know how to treat assignments where the rhs is a noreturn expression. And that is probably fine since such expressions should be replaced with assert(0).

For each statements over noreturn arrays, the compiler ends up generating el = __r[idx], therefore trying to assign a noreturn expression. With this patch, the mentioned assignment is replaced with assert(0).

I'm targeting master because this is the first step to unblock dlang/phobos#8283

@dlang-bot
Copy link
Contributor

dlang-bot commented Jul 8, 2022

Thanks for your pull request and interest in making D better, @RazvanN7! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
21956 critical ice on foreach over an AA of noreturn

⚠️⚠️⚠️ Warnings ⚠️⚠️⚠️

To target stable perform these two steps:

  1. Rebase your branch to upstream/stable:
git rebase --onto upstream/stable upstream/master
  1. Change the base branch of your PR to stable

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#14274"

@RazvanN7 RazvanN7 force-pushed the Issue_21956 branch 3 times, most recently from 12e60d7 to 420f07e Compare July 8, 2022 10:37
@RazvanN7 RazvanN7 changed the title Fix Issue 21956 - Issue 21956 - ice on foreach over an AA of noreturn Fix Issue 21956 - ice on foreach over an AA of noreturn Jul 8, 2022
@thewilsonator
Copy link
Contributor

ICEs go to stable

@RazvanN7
Copy link
Contributor Author

RazvanN7 commented Jul 8, 2022

I'm targeting master because this is the first step to unblock dlang/phobos#8283

Also, noreturn is just half implemented. If I were to decide, I would have put it behind a preview switch. Anyway, I have more fixes for noreturn on my pipeline and it would be easier to put them in master.

@RazvanN7
Copy link
Contributor Author

RazvanN7 commented Jul 8, 2022

cc @dkorpel . Is this in line with the DIP?

@ibuclaw
Copy link
Member

ibuclaw commented Jul 9, 2022

ICEs go to stable

Probably need an ltsstable branch soon too. :-)

@RazvanN7 RazvanN7 added the Blocking Other Work review and pulling should be a priority label Jul 12, 2022
@RazvanN7 RazvanN7 merged commit c5b8eb1 into dlang:master Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocking Other Work review and pulling should be a priority Bug Fix
Projects
None yet
4 participants