Skip to content

Commit

Permalink
Issue 4543 - Regression(1.054, 2.038) typedef causes circular definit…
Browse files Browse the repository at this point in the history
…ion and segfault - fix the circular definition
  • Loading branch information
Iain Buclaw authored and WalterBright committed Apr 19, 2011
1 parent 0c68e90 commit c986001
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,14 +870,14 @@ Dsymbol *ClassDeclaration::search(Loc loc, Identifier *ident, int flags)
Dsymbol *s;
//printf("%s.ClassDeclaration::search('%s')\n", toChars(), ident->toChars());

if (scope)
if (scope && !symtab)
{ Scope *sc = scope;
sc->mustsemantic++;
semantic(sc);
sc->mustsemantic--;
}

if (!members || !symtab || scope)
if (!members || !symtab)
{
error("is forward referenced when looking for '%s'", ident->toChars());
//*(char*)0=0;
Expand Down
2 changes: 1 addition & 1 deletion src/struct.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ Dsymbol *StructDeclaration::search(Loc loc, Identifier *ident, int flags)
{
//printf("%s.StructDeclaration::search('%s')\n", toChars(), ident->toChars());

if (scope)
if (scope && !symtab)
semantic(scope);

if (!members || !symtab)
Expand Down

0 comments on commit c986001

Please sign in to comment.