← Back to index
|
Original Bugzilla link
Bug 6781 – Regression(2.055): Segfault with error in local alias template
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-10-07T11:20:00Z
Last change time
2011-10-18T12:18:02Z
Keywords
ice-on-invalid-code
Assigned to
nobody
Creator
dsimcha
Comments
Comment #0
by dsimcha — 2011-10-07T11:20:26Z
test.d: ubyte delegate() outer() { ubyte inner() { return typeof(return).init; } return &inner; } class C { uint[] sortedIndices; void makeSortedIndices() { auto comparator = outer(); bool greater(uint index1, uint index2) { return comparator() == 1; } sort!greater(sortedIndices); } } void sort(alias comp, T)(T data) { T less; size_t lessI = size_t.max, greaterI = data.length - 1; less[ti] = data[0..min(lessI, greaterI + 1)]; } $ dmd -c test.d -v binary dmd version v2.055 config /home/dsimcha/dmd2/linux/bin64/dmd.conf parse test importall test import object (/home/dsimcha/dmd2/linux/bin64/../../src/druntime/import/object.di) semantic test semantic2 test semantic3 test Segmentation fault
Comment #1
by clugdbug — 2011-10-17T23:16:53Z
This is ice-on-invalid code. Reduced test case: void bug6781(alias xxx)() { some_error; } struct C6781 { void makeSortedIndices() { int greater; bug6781!greater(); } }
Comment #2
by bugzilla — 2011-10-18T12:18:02Z
https://github.com/D-Programming-Language/dmd/commit/6e4f808ca5b4d5222f2e1d677fd6f90fb02fe117