Bug 12460 – Crash with goto and static if

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-25T02:56:00Z
Last change time
2015-06-17T21:03:45Z
Keywords
ice, pull
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2014-03-25T02:56:11Z
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
Comment #1 by k.hara.pg — 2014-04-07T06:19:05Z
Comment #2 by github-bugzilla — 2014-04-07T08:32:29Z
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
Comment #3 by github-bugzilla — 2015-03-29T07:39:17Z
Comment #4 by github-bugzilla — 2015-06-17T21:03:45Z