www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11849] New: Recursive enum causes segfault

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11849

           Summary: Recursive enum causes segfault
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: doob me.com



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
}

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 30 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11849


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



https://github.com/D-Programming-Language/dmd/pull/3057

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 03 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11849





 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. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 03 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11849






 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. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 03 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11849






 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. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 03 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11849






 
 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. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 04 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11849




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/1cb5407fdf29c57511e048e332840d0bf45b529c
fix Issue 11849 - Recursive enum causes segfault

https://github.com/D-Programming-Language/dmd/commit/80da22ed3e800755a53fc54bcc938627d4611fc6


Issue 11849 - Recursive enum causes segfault

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 05 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11849


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 05 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11849




Thanks.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 05 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11849


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |regression




 alias DWORD = uint;
 
 enum : DWORD
 {
     REG_DWORD = 4
 }
 
 enum RegValueType : DWORD
 {
     Unknown = DWORD.max,
     DWORD = REG_DWORD
 }
This code meaning was changed from 2.064, but infinite loop did not occur with 2.063. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 07 2014
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11849




Commit pushed to 2.065 at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/0895bed3880b2f925e30cc53727d6cfd533a4c8c


Issue 11849 - Recursive enum causes segfault

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 07 2014