D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7178 - Segfault with import of invalid template
Summary: Segfault with import of invalid template
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other All
: P2 normal
Assignee: No Owner
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2011-12-28 10:34 UTC by Robert Clipsham
Modified: 2012-01-28 20:46 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 Robert Clipsham 2011-12-28 10:34:52 UTC
a.d:
----
static if(is(typeof({import typecons;}()))){
}
----

typecons.d:
----
template populate(overloads...)
{
    mixin populate!(.contents);
}
public mixin populate!int;
----

With the above code, dmd segfaults when using "dmd -c a.d". While typecons.d is invalid, a.d is valid, and it should compile regardless of the validity of typecons. Note that this can probably be triggered with valid code in typecons.d as it was reduced from std.typecons.
Comment 1 github-bugzilla 2012-01-28 20:44:30 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/929b6cbd3f16ef20766f5c70b1cd3a759a4fd412
Issue 7178 - Segfault with import of invalid template
Comment 2 github-bugzilla 2012-01-28 20:44:38 UTC
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/6be191a149cbfc66c720846d542559e46c0c895f
Issue 7178 - Segfault with import of invalid template