D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 11315 - dmd: Internal error: ..\ztc\cgcod.c 1561
Summary: dmd: Internal error: ..\ztc\cgcod.c 1561
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: ice
Depends on:
Blocks:
 
Reported: 2013-10-21 10:41 UTC by Walter Bright
Modified: 2013-11-11 21:20 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 Walter Bright 2013-10-21 10:41:32 UTC
int[] test()
{
    int[] x;
    int[3] y;
    x = y = [1, 2, 3];
    return x;
}

void fill()
{
    int[100] x;
}

void main()
{
    auto a = test();
	
    fill();
	
    assert(a[0] == 1);
    assert(a[1] == 2);
    assert(a[2] == 3);
}
Comment 1 Iain Buclaw 2013-10-21 10:50:24 UTC
Don't need all that file:


int[] test()
{
    int[] x;
    int[3] y;
    x = y = [1, 2, 3];
    return x;
}



Is enough to reproduce  (I believe it is the x = y = [1,2,3] line).
Comment 2 Walter Bright 2013-11-11 20:14:22 UTC
With dmd head, I am unable to reproduce the assert failure. But it does still assert at runtime with the first example.
Comment 3 Walter Bright 2013-11-11 21:20:07 UTC
(In reply to comment #2)
> But it does still
> assert at runtime with the first example.

And it should fail, as it is returning a pointer to a local.

So, I'm going to close this as "worksforme" because the assert no longer trips.