← Back to index
|
Original Bugzilla link
Bug 17955 – compiler segfault in DsymbolSemanticVisitor::visit(UnittestDeclaration*)
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-10-31T10:05:01Z
Last change time
2017-12-18T22:56:24Z
Keywords
ice-on-invalid-code
Assigned to
No Owner
Creator
John Colvin
Comments
Comment #0
by john.loughran.colvin — 2017-10-31T10:05:01Z
The following code causes dmd to segfault. The regression was introduced by
https://github.com/dlang/dmd/pull/7198
Sorry for the large test case, couldn't seem to get it any smaller than this: alias Alias(alias a) = a; template isISOExtStringSerializable(T) { enum isISOExtStringSerializable = T.fromISOExtString(""); } template RedisObjectCollection(){} struct RedisStripped(T, bool strip_id = true) { alias unstrippedMemberIndices = indicesOf!(Select!(strip_id, isRedisTypeAndNotID, isRedisType), T.tupleof); } template indicesOf(alias PRED, T...) { template impl(size_t i) { static if (PRED!T) impl TypeTuple; } alias indicesOf = impl!0; } template isRedisType(alias F) { enum isRedisType = toRedis!(typeof(F)); } template isRedisTypeAndNotID(){} string toRedis(T)() { static if (isISOExtStringSerializable!T) return; } struct User { SysTime resetCodeExpireTime; } class RedisUserManController { RedisObjectCollection!(RedisStripped!User) m_users; } class TimeZone { abstract bool hasDST(); } class SimpleTimeZone : TimeZone { unittest {} immutable(SimpleTimeZone) fromISOExtString(S)(S) { new SimpleTimeZone; } } struct SysTime { static fromISOExtString(S)(S) { dstring zoneStr; try SimpleTimeZone.fromISOExtString(zoneStr); catch DateTimeException; } } template Select(bool condition, T...) { alias Select = Alias!(T[condition]); }
Comment #1
by bugzilla — 2017-11-02T05:47:22Z
https://github.com/dlang/dmd/pull/7277
Comment #2
by github-bugzilla — 2017-11-03T08:17:00Z
Commits pushed to master at
https://github.com/dlang/dmd
https://github.com/dlang/dmd/commit/a32b62f9415c65df9186037fbfe2f9acc1f5be56
fix Issue 17955 - compiler segfault in DsymbolSemanticVisitor::visit(UnittestDeclaration*)
https://github.com/dlang/dmd/commit/56e48617fa91c80555abdcb5251861d3ed4099a7
Merge pull request #7277 from WalterBright/fix17955 fix Issue 17955 - compiler segfault in DsymbolSemanticVisitor::visit(… merged-on-behalf-of: Iain Buclaw <
[email protected]
>
Comment #3
by code — 2017-11-29T13:54:54Z
*** Issue 18012 has been marked as a duplicate of this issue. ***
Comment #4
by github-bugzilla — 2017-11-29T14:39:27Z
Commit pushed to stable at
https://github.com/dlang/dmd
https://github.com/dlang/dmd/commit/a41e3d26d62d498551abeb0da10c7356731b0fe7
Merge pull request #7277 from WalterBright/fix17955 fix Issue 17955 - compiler segfault in DsymbolSemanticVisitor::visit(… merged-on-behalf-of: Iain Buclaw <
[email protected]
>
Comment #5
by github-bugzilla — 2017-11-30T09:06:57Z
Commit pushed to master at
https://github.com/dlang/dmd
https://github.com/dlang/dmd/commit/a41e3d26d62d498551abeb0da10c7356731b0fe7
Merge pull request #7277 from WalterBright/fix17955
Comment #6
by github-bugzilla — 2017-12-18T22:56:24Z
Commits pushed to stable at
https://github.com/dlang/dmd
https://github.com/dlang/dmd/commit/a32b62f9415c65df9186037fbfe2f9acc1f5be56
fix Issue 17955 - compiler segfault in DsymbolSemanticVisitor::visit(UnittestDeclaration*)
https://github.com/dlang/dmd/commit/56e48617fa91c80555abdcb5251861d3ed4099a7
Merge pull request #7277 from WalterBright/fix17955