www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12460] New: Crash with goto and static if

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

           Summary: Crash with goto and static if
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: code benjamin-thaut.de


--- Comment #0 from Benjamin Thaut <code benjamin-thaut.de> 2014-03-25 02:56:11
PDT ---
The following will create a access violation by accessing a null pointer in
statement.c line 5212 (LabelStatement::syntaxCopy)

void func(T)()
{
  static if(is(T == int))
  {
    goto end;
  }
  end:
}

void main(string[] args)
{
  func!int();
}

I tested this with dmd 2.065

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


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

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


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2014-04-07 06:19:05 PDT ---
https://github.com/D-Programming-Language/dmd/pull/3434

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



--- Comment #2 from github-bugzilla puremagic.com 2014-04-07 08:32:29 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/15fa38b9238c1bfb56214dc6ac76963843c011c6
fix Issue 12460 - Crash with goto and static if

By implementing issue 10199, LabelStatement::statement may be NULL. So
LabelStatement::syntaxCopy should consider the case.

https://github.com/D-Programming-Language/dmd/commit/aee4e6d51ed3d26b26eb2b7af5ee15d35b7664eb
Merge pull request #3434 from 9rnsr/fix12460

Issue 12460 - Crash with goto and static if

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


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: -------
Apr 07 2014