D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 13920 - DMD crash when trying to set a delegate from __traits(getOverloads)
Summary: DMD crash when trying to set a delegate from __traits(getOverloads)
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 major
Assignee: Kenji Hara
URL:
Keywords: ice, pull
: 14448 (view as issue list)
Depends on:
Blocks:
 
Reported: 2015-01-01 11:18 UTC by basile-z
Modified: 2020-03-21 03:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description basile-z 2015-01-01 11:18:15 UTC
import std.stdio;

struct get{}
struct set{}

mixin template attrAna(){

    private void Ana()
    {
        foreach(m; __traits(allMembers, typeof(this)))
            foreach(o; __traits(getOverloads, typeof(this), m))    
                foreach(attr; __traits(getAttributes, o))
                    static if (is(attr == get)){
                        o;
                        auto ICE = &o; //comment = no crash  
                    }            
    }
}

class Foo{
    mixin attrAna;
    this(A...)(A a){Ana;}
    private uint _prop;
    public @get uint propA(){writeln("o");return _prop;}
    public @set void propA(uint aValue){_prop = aValue;}
}

void main(string args[]){
    auto foo = new Foo;
}

Maybe related to 9552
Comment 1 Kenji Hara 2015-01-19 09:37:41 UTC
My pull request will handle every overloads correctly, then automatically fix the ICE issue.

https://github.com/D-Programming-Language/dmd/pull/2130
Comment 2 Kenji Hara 2015-04-14 13:26:28 UTC
*** Issue 14448 has been marked as a duplicate of this issue. ***
Comment 4 github-bugzilla 2015-04-17 05:18:09 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/c8173f3a87a14312f734f584af80fa686b4333f3
fix Issue 13920 - DMD crash when trying to set a delegate from __traits(getOverloads)

https://github.com/D-Programming-Language/dmd/commit/bb7947b2d64286118e79197a06cc78441bb302b2
Merge pull request #4589 from 9rnsr/fix13920

Issue 13920 - DMD crash when trying to set a delegate from __traits(getOverloads)
Comment 5 github-bugzilla 2015-06-17 21:04:47 UTC
Commits pushed to stable at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/c8173f3a87a14312f734f584af80fa686b4333f3
fix Issue 13920 - DMD crash when trying to set a delegate from __traits(getOverloads)

https://github.com/D-Programming-Language/dmd/commit/bb7947b2d64286118e79197a06cc78441bb302b2
Merge pull request #4589 from 9rnsr/fix13920