Skip to content

Commit

Permalink
Add safeguard to SecondPass::Recurse
Browse files Browse the repository at this point in the history
Should prevent future crashes with empty structs/classes
  • Loading branch information
RA-Kooi committed Dec 26, 2021
1 parent b6df233 commit 647e94c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions DwarfOne2C/Parsing/CompilationUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,9 @@ void Recurse(Tag parent, int depth)
}
}

if(child.tagType == TagType.Class
|| child.tagType == TagType.Struct)
if((child.tagType == TagType.Class
|| child.tagType == TagType.Struct)
&& child.firstChild != -1)
{
Recurse(child, 1);
}
Expand Down

0 comments on commit 647e94c

Please sign in to comment.