[Issue 9720] OSX wrong code with -o "Illegal instruction"
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Mon Apr  1 21:12:03 PDT 2013
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=9720
--- Comment #2 from Walter Bright <bugzilla at digitalmars.com> 2013-04-01 21:11:59 PDT ---
Reduced test case:
------------------
import core.stdc.stdio;
struct Payload
{
    size_t _capacity; //Comment me
    int[] _pay;       //Comment me
    size_t insertBack(Data d)
    {
        immutable newLen   = _pay.length + 3;
        _pay.length = newLen;
        _pay = _pay[0 .. newLen]; //Comment me
        return 3;
    }
}
struct Impl
{
    Payload _payload;
    size_t _count;
}
struct Data
{
    Impl* _store;
    this(int i)
    {
        _store = new Impl;
        _store._payload = Payload.init;
    }
    ~this()
    {
        printf("%d\n", _store._count);
        --_store._count;
    }
}
void main()
{
    auto a = Data(1);
    auto b = Data(1);
    a._store._payload.insertBack(b); //Fails
}
-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
    
    
More information about the Digitalmars-d-bugs
mailing list