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 22390 - Compiler crash when iterating empty array of bottom types #14294

Merged
merged 1 commit into from
Jul 15, 2022

Conversation

RazvanN7
Copy link
Contributor

I'm not sure this is the right fix. I tracked this down to the backend where the opcode for a specific jump is generated. Since noreturn is neither signed, nor unsigned I simply went with what is done for pointers.

cc @WalterBright .

@dlang-bot
Copy link
Contributor

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
22390 critical Compiler crash when iterating empty array of bottom types

⚠️⚠️⚠️ 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#14294"

@thewilsonator
Copy link
Contributor

ICEs go to stable

@RazvanN7
Copy link
Contributor Author

Firstly, I don't feet comfortable this going to stable. Secondly, this is currently needed to unblock dlang/phobos#8283 which is targeting master.

@Geod24
Copy link
Member

Geod24 commented Jul 12, 2022

Since .1 has just been tagged I think we can let this go to master. CC @ibuclaw

@dukc
Copy link
Contributor

dukc commented Jul 12, 2022

Secondly, this is currently needed to unblock dlang/phobos#8283 which is targeting master.

I'm not sure my trivial PR is worth to delay crash fixes like this one 😄 . Thanks anyway!

@WalterBright
Copy link
Member

Code generation winds up instantiating the template core.array.equality, which attempts to generate code for it. But code for it makes no sense.

empty==empty should simply constant fold to true.

Copy link
Member

@WalterBright WalterBright left a comment

Choose a reason for hiding this comment

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

See my comment

@WalterBright
Copy link
Member

Two arrays of noreturn should simply compare the lengths when doing an equality check.

@RazvanN7
Copy link
Contributor Author

@WalterBright Thanks for the clarification. It does make sense to check the length in this situation. I have updated the code.

@RazvanN7 RazvanN7 requested a review from WalterBright July 14, 2022 15:39
@WalterBright WalterBright merged commit d20b7c9 into dlang:master Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants