Bug 16618 – [REG2.055] Segmentation fault in DMD with cyclic alias this and unknown identifier

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-10-16T13:56:05Z
Last change time
2018-10-25T14:06:08Z
Keywords
ice
Assigned to
No Owner
Creator
changlon

Comments

Comment #0 by changlon — 2016-10-16T13:56:05Z
```d struct embed(T) { alias payload this; @property payload() inout { embed_instance ; } } class Bufferz { } struct Buffer { embed!Bufferz _range ; pragma(inline) { } } ```
Comment #1 by changlon — 2016-10-16T14:07:46Z
for v2.072.0-b2 ```sh struct embed(T) { T embed_instance ; @property payload() { return embed_instance ; } } class Bufferz { alias owner this ; Buffer* _owner ; auto owner() { return _owner ; } } struct Buffer { alias range this ; embed!Bufferz _range ; auto range() { return _range.payload ; } ref slice() { Slice; } pragma(inline) { } } ```
Comment #2 by ag0aep6g — 2016-10-16T16:30:15Z
(In reply to changlon from comment #1) Reduced/simplified further: ---- class Bufferz { alias owner this; Buffer owner() { return Buffer.init; } } struct Buffer { alias range this; Bufferz range() { return Bufferz.init; } void slice() { error; } } ---- You marked this as a regression, but you didn't specify which previous version of dmd doesn't have the problem. For a bug to be a regression, the code must have worked at some point. Downgrading to "normal".
Comment #3 by razvan.nitu1305 — 2018-10-25T14:06:08Z
Compiling this with dmd 2.081 issues: Error: undefined identifier embed_instance and no seg fault. Closing as fixed