Skip to content

Commit

Permalink
Merge pull request #5611 from rainers/fix_13975
Browse files Browse the repository at this point in the history
fix issue 13975 - ICE: dmd crash if -gc and enum member is immutable int
  • Loading branch information
9rnsr committed Apr 3, 2016
2 parents fc39cc6 + 89abc74 commit af845b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backend/cgcv.c
Expand Up @@ -1855,7 +1855,7 @@ unsigned cv4_typidx(type *t)
// The visual studio debugger gets confused with pointers to arrays, emit a reference instead.
// This especially happens when passing arrays as function arguments because 64bit ABI demands
// passing structs > 8 byte as pointers.
if((config.flags2 & CFG2gms) && t->Tnext && t->Tnext->Tty == TYdarray)
if((config.flags2 & CFG2gms) && t->Tnext && tybasic(t->Tnext->Tty) == TYdarray)
TOLONG(d->data + 6,attribute | 0x20);
else
{
Expand Down Expand Up @@ -2113,7 +2113,7 @@ unsigned cv4_typidx(type *t)
typidx = cv4_enum(t->Ttag);
else
#endif
typidx = dttab4[t->Tnext->Tty];
typidx = dttab4[tybasic(t->Tnext->Tty)];
break;

#if SCPP
Expand Down
6 changes: 6 additions & 0 deletions test/compilable/debuginfo.d
Expand Up @@ -12,3 +12,9 @@ void main() {
Bug7127a a;
Bug7127b b;
}

// https://issues.dlang.org/show_bug.cgi?id=13975
static immutable int a = 8;
enum Bar { aa = a }

void foo(Bar bar) {}

0 comments on commit af845b7

Please sign in to comment.