www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11926] New: Segmentation fault when using const in an enum

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

           Summary: Segmentation fault when using const in an enum
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: michaelpm394 gmail.com


--- Comment #0 from michaelpm394 gmail.com 2014-01-14 15:32:12 PST ---
Doing:
enum {
    const a = 1,
    const b = 2
}

will result in a segmentation fault.

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


Iain Buclaw <ibuclaw ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw ubuntu.com
           Severity|normal                      |major


--- Comment #1 from Iain Buclaw <ibuclaw ubuntu.com> 2014-01-14 15:49:27 PST ---
Raising to major - a corrupt Identifier pointer causes the ICE.

{
  <RootObject> = {_vptr.RootObject = 0x0},
  value = 25720336,
  string = 0x5a95dc, // Unreadable address
  len = 0
}


(gdb) bt
#0  0x00000000005a755c in Dsymbol::toChars (this=<optimised out>) at
../../gcc-devel/gcc/d/dfrontend/dsymbol.c:203
#1  0x00000000005a79aa in Dsymbol::toPrettyChars (this=0x18a2720) at
../../gcc-devel/gcc/d/dfrontend/dsymbol.c:218
#2  0x00000000005a95dc in ScopeDsymbol::multiplyDefined (loc=..., s1=0x18a28c0,
s2=0x18a2720) at ../../gcc-devel/gcc/d/dfrontend/dsymbol.c:1049
#3  0x00000000005a96ea in Dsymbol::addMember (this=0x7fffffffd978, sc=0x0,
sd=0x1887610, memnum=0) at ../../gcc-devel/gcc/d/dfrontend/dsymbol.c:610
#4  0x00000000005aadfe in EnumDeclaration::addMember (this=0x18a24a0, sc=0x0,
sd=<optimised out>, memnum=1) at ../../gcc-devel/gcc/d/dfrontend/enum.c:
105
#5  0x000000000061480e in Module::importAll (this=0x7fffffffd978, prevsc=0x0)
at ../../gcc-devel/gcc/d/dfrontend/module.c:659
#6  0x000000000065aff0 in d_parse_file () at
../../gcc-devel/gcc/d/d-lang.cc:988
#7  0x0000000000a3a9c5 in compile_file () at ../../gcc-devel/gcc/toplev.c:547
#8  0x0000000000a3c922 in do_compile () at ../../gcc-devel/gcc/toplev.c:1887
#9  toplev_main (argc=18, argv=0x7fffffffdc58) at
../../gcc-devel/gcc/toplev.c:1963
#10 0x00007ffff6e43de5 in __libc_start_main (main=0x5734f0 <main(int, char**)>,
argc=18, ubp_av=0x7fffffffdc58, init=<optimised out>, fini=<optimised
out>, rtld_fini=<optimised out>, stack_end=0x7fffffffdc48) at libc-start.c:260
#11 0x00000000005735c8 in _start ()

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice, pull
           Platform|x86                         |All
         OS/Version|Linux                       |All


--- Comment #2 from Kenji Hara <k.hara.pg gmail.com> 2014-01-14 18:20:17 PST ---
https://github.com/D-Programming-Language/dmd/pull/3098

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



--- Comment #3 from github-bugzilla puremagic.com 2014-01-14 23:27:31 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/c89e6d30d4c392c9ec942e0b08b29d4eab3546ec
fix Issue 11926 - Segmentation fault when using const in an enum

https://github.com/D-Programming-Language/dmd/commit/df5b5365fbccb9c571ccce7cc43232e4f49b646c
Merge pull request #3098 from 9rnsr/fix11926

Issue 11926 - Segmentation fault when using const in an enum

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


Iain Buclaw <ibuclaw ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
           Platform|All                         |x86
         Resolution|                            |FIXED
         OS/Version|All                         |Linux


--- Comment #4 from Iain Buclaw <ibuclaw ubuntu.com> 2014-01-14 23:28:43 PST ---
(In reply to comment #2)
 https://github.com/D-Programming-Language/dmd/pull/3098

https://github.com/D-Programming-Language/dmd/commit/df5b5365fbccb9c571ccce7cc43232e4f49b646c -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 14 2014