]> granicus.if.org Git - clang/commitdiff
Don't try to call getFileCharacteristic if the function declaration has an invalid...
authorAnders Carlsson <andersca@mac.com>
Sun, 31 May 2009 20:19:23 +0000 (20:19 +0000)
committerAnders Carlsson <andersca@mac.com>
Sun, 31 May 2009 20:19:23 +0000 (20:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72671 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/Mangle.cpp

index c09a13a59f329fb6b7feeff49f9a1a18d8149679..6ee1223a0059409b5f732c43cad782723f14795c 100644 (file)
@@ -93,8 +93,9 @@ bool CXXNameMangler::mangleFunctionDecl(const FunctionDecl *FD) {
              !Context.getLangOptions().CPlusPlus ||
              // "main" is not mangled in C++
              FD->isMain() ||
-             // No mangling in an "implicit extern C" header.
-             Context.getSourceManager().getFileCharacteristic(FD->getLocation())
+             // No mangling in an "implicit extern C" header. 
+             (FD->getLocation().isValid() && 
+              Context.getSourceManager().getFileCharacteristic(FD->getLocation()))
                == SrcMgr::C_ExternCSystem ||
              // No name mangling in a C linkage specification.
              isInCLinkageSpecification(FD))