← Back to index
|
Original Bugzilla link
Bug 15317 – Segfault in Type::kind() with DMD v2.069.0
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-11-11T11:35:00Z
Last change time
2016-01-03T14:02:26Z
Keywords
ice, pull
Assigned to
nobody
Creator
petar.p.kirov
Comments
Comment #0
by petar.p.kirov — 2015-11-11T11:35:03Z
I currently don't have time to reduce the issue, so I am posting the full source code: // Writes a numbered table of contents with in-page links of markdown file. import std.stdio : File, writeln; import std.file : readText; import std.ascii : isAlphaNum, isWhite, toLower; import std.algorithm : countUntil, each, filter, find, findSplit, joiner, map, splitter, stripRight; import std.array : replaceLast, replace; import std.range : chain, drop, front, tee; import std.string; import std.conv : to; void main() { enum indent = " "; uint lastLvl = 1; uint lvl = 1; uint titleNum = 1; File("markdown_test.md") .byLine .filter!(line => line.startsWith("#")) .tee!((line) { auto currLvl = countUntil!(ch => ch.isAlphaNum)(line, "#"); titleNum = (currLvl == lastLvl)? titleNum + 1 : 1; lastLvl = cast(uint)currLvl; }) .map!(line => line.stripRight('#')) .map!(line => line.replaceLast("#", titleNum.to!string ~ ".")) .map!(line => line.find(".").drop(1).front.isWhite? line : line.replace(".", ". ")) .map!(line => line.replace("#", indent)) .map!((line) { auto split = line.findSplit(". "); auto escaped = split[2] .filter!(ch => ch.isAlphaNum || ch.isWhite) .map!(ch => ch.toLower) .to!string .strip .splitter!(ch => ch.isWhite) .joiner("-"); return chain( split[0], split[1], "[", split[2].strip, "]", "(#", escaped, ")" ); }) .each!(line => line.writeln); }
Comment #1
by petar.p.kirov — 2015-11-11T11:38:03Z
When I run DMD with dmd -c this_file.d I get an compile-time error message (which is expected) and then DMD segfaults.
Comment #2
by k.hara.pg — 2015-11-12T14:34:18Z
https://github.com/D-Programming-Language/dmd/pull/5265
Comment #3
by github-bugzilla — 2015-11-15T12:07:57Z
Commits pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/0c8415056e801d414222bc6f2cf7a15e6d2a2c7a
fix Issue 15317 - Segfault in Type::kind() with DMD v2.069.0 `TypeExp.semantic` should return `ErrorExp` if the `type` is `Terror`.
https://github.com/D-Programming-Language/dmd/commit/2c3a160e10367f4750e06694779e78a9de81be1d
Merge pull request #5265 from 9rnsr/fix15317 Issue 15317 - Segfault in Type::kind() with DMD v2.069.0
Comment #4
by github-bugzilla — 2016-01-03T14:02:26Z
Commits pushed to stable at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/0c8415056e801d414222bc6f2cf7a15e6d2a2c7a
fix Issue 15317 - Segfault in Type::kind() with DMD v2.069.0
https://github.com/D-Programming-Language/dmd/commit/2c3a160e10367f4750e06694779e78a9de81be1d
Merge pull request #5265 from 9rnsr/fix15317