www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8795] New: mixing in "switch" or "interface;" makes dmd segfault

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

           Summary: mixing in "switch" or "interface;" makes dmd segfault
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: ice
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: nilsbossung googlemail.com



---
A) mixing in "switch"
---
cat > test.d <<code
void s() {mixin("switch");}
code
dmd -c -o- test.d
---
test.d(1): Error: found 'EOF' when expecting '('
test.d(1): Error: expression expected, not 'EOF'
test.d(1): Error: found 'EOF' when expecting ')'
test.d(1): Error: found 'EOF' instead of statement
Segmentation fault (core dumped)
---

B) mixing in "interface;"
---
cat > test.d <<code
mixin("interface;");
code
dmd -c -o- test.d
---
test.d(1): Error: anonymous classes not allowed
Segmentation fault (core dumped)
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 10 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8795


hsteoh quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh quickfur.ath.cx



In (A), the segfault is happening in SwitchStatement::semantic(Scope*)
[statement.c:3101], from attempting to dereference a null pointer (body =
body->semantic(sc); where body==NULL). Looks like the body is null because it
was an invalid switch mixin, but for some reason the compiler didn't catch the
syntax error and proceeded to create a SwitchStatement with a NULL body.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 28 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8795


hsteoh quickfur.ath.cx changed:

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



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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 29 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8795




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

https://github.com/D-Programming-Language/dmd/commit/2d0de85d28e1d953f7590ea6888bc6a12c25bd35


Fix issue 8795: segfault on mixin("switch") and mixin("interface;")

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 30 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8795


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

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


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 30 2013