diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2010-01-16 00:43:13 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2010-01-16 00:43:13 +0000 |
commit | 3364e626147dd6fc5e33d12cda0eaaa50baf2206 (patch) | |
tree | 75e8b2a1d1f4e25556cccdb6f77a7faba77cdf19 /lib/CodeGen/CGDebugInfo.cpp | |
parent | edc8aa68ef91aeea686c5aadf64ef902c38318dd (diff) |
Fix crash generating debug info for constructor for anonymous struct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93601 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index ab8f6637d6..cc97d19a5a 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1001,7 +1001,7 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType, const Decl *D = GD.getDecl(); if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { Name = getFunctionName(FD); - if (Name[0] == '\01') + if (!Name.empty() && Name[0] == '\01') Name = Name.substr(1); // Use mangled name as linkage name for c/c++ functions. LinkageName = CGM.getMangledName(GD); |