From 12edad2c50b7e0ae844e009c708d340376ba5636 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Wed, 1 Apr 2009 00:42:16 +0000 Subject: [PATCH] Fix a bug (that I thought I had fixed already) where mangling a prefix could get us into an infinite loop llvm-svn: 68168 --- clang/lib/CodeGen/Mangle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/lib/CodeGen/Mangle.cpp b/clang/lib/CodeGen/Mangle.cpp index 427cc76646b4..cd97b5d916c6 100644 --- a/clang/lib/CodeGen/Mangle.cpp +++ b/clang/lib/CodeGen/Mangle.cpp @@ -219,8 +219,8 @@ void CXXNameMangler::manglePrefix(const DeclContext *DC) { // ::= # empty // ::= // 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(DC)) mangleSourceName(Namespace->getIdentifier()); -- GitLab