September 04, 2014 [Issue 13424] New: Initialization of delegate to do-nothing default causes segfault at runtime | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=13424 Issue ID: 13424 Summary: Initialization of delegate to do-nothing default causes segfault at runtime Product: D Version: D2 Hardware: x86 OS: Linux Status: NEW Severity: critical Priority: P1 Component: DMD Assignee: nobody@puremagic.com Reporter: hsteoh@quickfur.ath.cx I have a struct of delegates that I'd like to default to do-nothing stubs: ------ struct S { void delegate(dchar ch) onChar = (dchar) {}; ... /* other delegate variables similarly initialized */ } ------ It compiles, but crashes at runtime. Looking at the assembly code, it appears to be attempting to call an invalid pointer. -- |
Copyright © 1999-2021 by the D Language Foundation