Skip to content

[REG 2.103] Class objects without explicit pointers are scanned by the GC #22599

Open

Description

@kinke

auto noPointers = new NoPointers;
// FIXME: regressed with v2.103
//assert(GC.getAttr(cast(void*) noPointers) & GC.BlkAttr.NO_SCAN);

Almost certainly caused by the _d_newclassT template; LDC isn't affected (still using _d_newclass based on TypeInfo). As _d_newclassT still uses the TypeInfo, it should IMO clearly have an assert verifying that the manual has-pointers logic yields the same result as the TypeInfo.

Activity

  1. added theissue type on Feb 20, 2026
  2. added
    Severity:Regression
    on Feb 20, 2026
  3. kinke commented on Feb 20, 2026

    @kinke
    ContributorAuthor

    Yeah this is clearly wrong:

    static if (!hasIndirections!T)
    attr |= BlkAttr.NO_SCAN;

    hasIndirections!T for some class T is always true, as a class ref is clearly a pointer. What needs to be done is checking if any explicit field in the class (incl. base classes) has indirections.

  4. added 2 commits that reference this issue on Feb 21, 2026
    45c058f
    7c6a389
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Severity:Regression

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions