Bug 15922 – DMD segfault in functionParameters()

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-04-13T23:54:00Z
Last change time
2016-10-01T11:46:09Z
Keywords
ice-on-invalid-code, industry, pull
Assigned to
nobody
Creator
briancschott

Comments

Comment #0 by briancschott — 2016-04-13T23:54:02Z
Dmd segfaults when compiling this code: template StorageAttributes(Store) { enum hasInsertMethod = Store.insert; enum hasFullSlice = Store.init[]; } struct ValidSparseDataStore(DataT) { DataT insert() { correctedInsert!(false); } DataT correctedInsert(bool CorrectParents)() {} auto opSlice() inout {} } alias BasicCubeT = StorageAttributes!(ValidSparseDataStore!int);
Comment #1 by mathias.lang — 2016-04-14T02:48:07Z
Comment #2 by github-bugzilla — 2016-04-14T17:45:14Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/aa0df5c0e9795dd2531de5083b764171356e59ad Fix issue 15922: DMD segfault in functionParameters on invalid code `Dsymbol.errors` is used to indicate a symbol failed semantic analysis. Currently, `FuncDeclaration.semantic3` fails if the parent has error, so the body of aggregates that already have errors is not processed. However, the code was only `return`ing and not setting `Dsymbol.errors` to `true`, resulting in this error being unnoticed by `functionSemantic`. https://github.com/D-Programming-Language/dmd/commit/bd46f551bb30999c68d3c79c284d6ac2af123d9b Merge pull request #5659 from mathias-lang-sociomantic/fix15922 Fix issue 15922: DMD segfault in functionParameters on invalid code
Comment #3 by github-bugzilla — 2016-10-01T11:46:09Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/aa0df5c0e9795dd2531de5083b764171356e59ad Fix issue 15922: DMD segfault in functionParameters on invalid code https://github.com/dlang/dmd/commit/bd46f551bb30999c68d3c79c284d6ac2af123d9b Merge pull request #5659 from mathias-lang-sociomantic/fix15922