Given the following files :
--- main.d:
import a;
import b;
auto GB(D!Q)
{
}
--- a.d
struct D(E)
{
void G() {
import d;
I;
}
}
--- b.d
import c;
enum N = O();
alias Q = R!(N, S);
--- c.d
enum S = 1;
struct O
{
}
struct R(O U, int W ) // extend to KPDateTime later
{
}
--- d.d
auto AB()
{
static if}
auto I()
{
AB;
}
dmd will segfault while trying to evaluate the static if condition.
Comment #1 by dlang-bot — 2020-09-05T16:09:34Z
@UplinkCoder updated dlang/dmd pull request #11585 "Fix Issue 21164 - segfault on incomplete static if" fixing this issue:
- Fix Issue 21164 - segfault on incomplete static if
With this change we now check for the exisitance of an static if
condition and will only proceed if there is one.
- Add test for issue 21164
https://github.com/dlang/dmd/pull/11585
Comment #2 by dlang-bot — 2020-09-11T08:21:29Z
dlang/dmd pull request #11585 "Fix Issue 21164 - segfault on incomplete static if" was merged into stable:
- 47f6017d6e65c875a1bff427ed997c678e16f068 by Stefan Koch:
Fix 21164 - segfault on incomplete static if
With this change we now check for the existance
of a static if condition and will only proceed
if there is one.
The test doesn't use the imports folder due to problems
with path changes on the error message for windows.
https://github.com/dlang/dmd/pull/11585
Comment #3 by dlang-bot — 2020-11-16T15:09:51Z
dlang/dmd pull request #11971 "[dmd-cxx] Backport fixes for Issue 18970 and 21164" was merged into dmd-cxx:
- cb42c98a9514f7366857f78379c6133c1e6bb098 by Stefan Koch:
Fix 21164 - segfault on incomplete static if
With this change we now check for the existance
of a static if condition and will only proceed
if there is one.
The test doesn't use the imports folder due to problems
with path changes on the error message for windows.
https://github.com/dlang/dmd/pull/11971