The following code causes a segmentation fault when compiled with DMD git HEAD:
alias DWORD = uint;
enum : DWORD
{
REG_DWORD = 4
}
enum RegValueType : DWORD
{
Unknown = DWORD.max,
DWORD = REG_DWORD
}
Seems to be an infinite loop. I don't know if it's the same problem but this code causes a segmentation fault as well:
enum : DWORD
{
DWORD = REG_DWORD
}
(In reply to comment #2)
> (In reply to comment #1)
> > https://github.com/D-Programming-Language/dmd/pull/3057
>
> Does that pull request handle the second case:
>
> enum : DWORD
> {
> DWORD = REG_DWORD
> }
>
> I don't see an explicit test for that case.
Do you mean this full test case?
module test;
alias DWORD = uint; // L3 first definition of 'test.DWORD'
enum : DWORD
{
REG_DWORD = 4
}
enum : DWORD
{
DWORD = REG_DWORD // L12 second definition of 'test.DWORD'
}
Output:
test.d(12): Error: enum member test.DWORD conflicts with alias test.DWORD at test.d(3)
There's no "recursive" definition, so that's not directly related to the reported segfault issue.
Comment #4 by doob — 2014-01-03T07:09:23Z
(In reply to comment #3)
> Do you mean this full test case?
No, I mean only exact this code:
enum : DWORD
{
DWORD = REG_DWORD
}
This is without having declared "DWORD" or "REG_DWORD" previously. That will cause a segmentation fault as well. Seems to be an infinite loop there as well.
Comment #5 by k.hara.pg — 2014-01-04T22:30:21Z
(In reply to comment #4)
> (In reply to comment #3)
>
> > Do you mean this full test case?
>
> No, I mean only exact this code:
>
> enum : DWORD
> {
> DWORD = REG_DWORD
> }
>
> This is without having declared "DWORD" or "REG_DWORD" previously. That will
> cause a segmentation fault as well. Seems to be an infinite loop there as well.
OK, I updated PR to fix the ICE.
Comment #6 by github-bugzilla — 2014-01-05T00:11:27Z