Skip to content

Fix Issue 22517 - Mark void as having indirections (handle const/immu…#22521

Open
Adityazzzzz wants to merge 1 commit intodlang:masterfrom
Adityazzzzz:fix-issue-22517
Open

Fix Issue 22517 - Mark void as having indirections (handle const/immu…#22521
Adityazzzzz wants to merge 1 commit intodlang:masterfrom
Adityazzzzz:fix-issue-22517

Conversation

@Adityazzzzz
Copy link
Contributor

This fixes a regression where dynamic arrays of void were being marked as NO_SCAN by the GC, potentially causing memory corruption if they contained pointers.

The Fix

  • Updated core.internal.traits.hasIndirections to return true for void.
  • Used Unqual!T to ensure this applies to const, immutable, and shared void as well.

Tests

  • Added a static assert to verify hasIndirections!void is true.
  • Updated existing tests in core.internal.traits that incorrectly asserted void had no indirections.

Fixes Issue 22517.

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @Adityazzzzz! 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

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

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

  • In preparation for migrating from Bugzilla to GitHub Issues, the issue reference syntax has changed. Please add the word "Bugzilla" to issue references. For example, Fix Bugzilla Issue 12345 or Fix Bugzilla 12345.(Reminder: the edit needs to be done in the Git commit message, not the GitHub pull request.)

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#22521"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants