Bug 5796 – ICE with pragma(msg, ...) after missing ';' in a template

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-03-30T08:37:00Z
Last change time
2012-01-31T01:09:35Z
Keywords
ice-on-invalid-code
Assigned to
clugdbug
Creator
kennytm

Comments

Comment #0 by kennytm — 2011-03-30T08:37:48Z
When a 'pragma(msg, ...)' pragma has a missing comma, the subsequent pragma(msg, ...) will result in a segfault. ------ template A(B) { pragma(msg, B) // <-- missing ';' enum A = 0; } enum a = A!int; pragma(msg, 0); ------ The error exists at least since 2.042 http://ideone.com/MVgnG, and still persists in 2.052. The segfault is raised in 'ExpInitializer::semantic' in 'init.c': Initializer *ExpInitializer::semantic(Scope *sc, Type *t) { //printf(".... exp = exp->semantic(sc); exp = resolveProperties(sc, exp); exp = exp->optimize(WANTvalue | WANTinterpret); Type *tb = t->toBasetype(); // <-- this line
Comment #1 by github-bugzilla — 2012-01-30T23:22:18Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ac69d4b9893725d0eb7f40002f73d0b280214b02 Merge pull request #665 from donc/ice5796 ICE bugs 5796 and 6720
Comment #2 by github-bugzilla — 2012-01-31T01:08:59Z
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/06b3b85c8f4e069d8a9a6224d155047ba83413c9 fix Issue 5796 - ICE with pragma(msg, ...) after missing ';' in a template