Bug 22975 – 3 cyclic aliases with meaningful overloads not caught [ice]
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2022-04-02T21:41:40Z
Last change time
2023-01-01T06:25:09Z
Keywords
ice-on-invalid-code, pull
Assigned to
No Owner
Creator
crazymonkyyy
Comments
Comment #0 by crazymonkyyy — 2022-04-02T21:41:40Z
```d
void foo(int){};
alias bar=foo;
void bar(bool){}
alias foobar=bar;
alias foo=foobar;
```
>Segmentation fault (core dumped)
Comment #1 by maxhaton — 2022-04-04T13:29:11Z
2.072.2 to 2.094.2: Failure with output:
-----
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
-----
Since 2.095.1: Segfault and no output
This is a regression.
Comment #2 by maxhaton — 2022-04-04T15:14:51Z
This forms a cycle in the overload list of `foo` (so overload apply becomes an infinite loop).
To complete the circle, the test case should be:
---
void foo(int){};
alias bar=foo;
void bar(bool){}
alias foobar=bar;
alias foo=foobar;
void foobar(float){}
---
As this constructs a tree where no single node representation is directly connected to any of its cyclic references.
Comment #5 by dlang-bot — 2022-12-27T16:23:11Z
@ibuclaw created dlang/dmd pull request #14744 "fix Issue 22975 - ICE: 3 cyclic aliases with meaningful overloads not caught" fixing this issue:
- fix Issue 22975 - ICE: 3 cyclic aliases with meaningful overloads not caught
https://github.com/dlang/dmd/pull/14744
Comment #6 by dlang-bot — 2022-12-31T02:44:44Z
dlang/dmd pull request #14744 "fix Issue 22975 - ICE: 3 cyclic aliases with meaningful overloads not caught" was merged into stable:
- f105e264d66ccbe1618b4dd2c4817c2eff2d7f30 by Iain Buclaw:
fix Issue 22975 - ICE: 3 cyclic aliases with meaningful overloads not caught
https://github.com/dlang/dmd/pull/14744
Comment #7 by dlang-bot — 2023-01-01T06:25:09Z
dlang/dmd pull request #14765 "merge stable" was merged into master:
- 6a406a59fe650f5ff90ce1dbca04f47f497f20c5 by Iain Buclaw:
fix Issue 22975 - ICE: 3 cyclic aliases with meaningful overloads not caught
https://github.com/dlang/dmd/pull/14765