Skip to content

Commit

Permalink
Merge pull request #4847 from 9rnsr/fix13792
Browse files Browse the repository at this point in the history
Issue 13792 - Segfault with a pointer of opaque enum type
  • Loading branch information
yebblies committed Aug 29, 2015
2 parents 20771f8 + 758a273 commit e51b397
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/toctype.c
Expand Up @@ -218,6 +218,11 @@ class ToCtypeVisitor : public Visitor
assert(0);
}
}
else if (!t->sym->memtype)
{
// Bugzilla 13792
t->ctype = Type_toCtype(Type::tvoid);
}
else if (t->sym->memtype->toBasetype()->ty == Tint32)
{
t->ctype = type_enum(t->sym->toPrettyChars(true), Type_toCtype(t->sym->memtype));
Expand Down
6 changes: 6 additions & 0 deletions test/compilable/ice13792.d
@@ -0,0 +1,6 @@
enum E;

void main()
{
E* p; // ICE in glue layer
}

0 comments on commit e51b397

Please sign in to comment.