Skip to content

Nested this register is not populated if only access is via getMember. #5203

Description

@FeepingCreature

This segfaults in LDC 1.42.0:

void main() { Struct().get; }
struct Struct {
    int field;
    int get() {
        int get2() {
            // cast(void) this;
            return __traits(getMember, this, "field");
        }
        return get2;
    }
}

See: https://godbolt.org/z/1joxsYPWq

If this is explicitly accessed, it works.

edit: Reported to also happen in LDC 1.41!

edit: And on master, alright.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions