Skip to content

Commit

Permalink
Fix infinite loop when finding base class
Browse files Browse the repository at this point in the history
I had the case that decl.baseClass.typeDecl is decl, moving the visited
assignment up fixed it (adding a check for decl !is decl.baseClass.typeDecl did
NOT fix it, so it might be a bit more complex)
  • Loading branch information
mathias-baumann-sociomantic committed Mar 4, 2015
1 parent 33e6480 commit 1608b46
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/ddox/processors/inherit.d
Expand Up @@ -73,12 +73,15 @@ void inheritDocs(Package root)
void scanClass(ClassDeclaration decl)
{
if (decl in visited) return;

visited[decl] = true;

if (decl.baseClass && decl.baseClass.typeDecl) scanClass(cast(ClassDeclaration)decl.baseClass.typeDecl);

foreach (i; decl.derivedInterfaces)
if (i.typeDecl)
scanInterface(cast(InterfaceDeclaration)i.typeDecl);

visited[decl] = true;
if (decl.baseClass && decl.baseClass.typeDecl)
inheritMembers(decl, (cast(ClassDeclaration)decl.baseClass.typeDecl).members, decl.baseClass.typeDecl);
foreach (i; decl.derivedInterfaces)
Expand Down

0 comments on commit 1608b46

Please sign in to comment.