Fix a bug (that I thought I had fixed already) where mangling a prefix could get us into an infinite loop

llvm-svn: 68168
This commit is contained in:
Anders Carlsson 2009-04-01 00:42:16 +00:00
parent 7f1f0b03e2
commit 12edad2c50
1 changed files with 2 additions and 2 deletions

View File

@ -219,8 +219,8 @@ void CXXNameMangler::manglePrefix(const DeclContext *DC) {
// ::= # empty
// ::= <substitution>
// FIXME: We only handle mangling of namespaces and classes at the moment.
if (DC->getParent() != DC)
manglePrefix(DC);
if (!DC->getParent()->isTranslationUnit())
manglePrefix(DC->getParent());
if (const NamespaceDecl *Namespace = dyn_cast<NamespaceDecl>(DC))
mangleSourceName(Namespace->getIdentifier());