summaryrefslogtreecommitdiff
path: root/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-02-04 05:31:37 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-02-04 05:31:37 +0000
commita9b1317443990533f56a8420c0fbfb8868dad566 (patch)
tree2c75249dc5545ebf60449fb24b30d514fe5909e1 /lib/IR/DebugInfo.cpp
parent6c355ee42714a92942b3b2368c1038bb01dc2641 (diff)
downloadllvm-a9b1317443990533f56a8420c0fbfb8868dad566.tar.gz
llvm-a9b1317443990533f56a8420c0fbfb8868dad566.tar.bz2
llvm-a9b1317443990533f56a8420c0fbfb8868dad566.tar.xz
PR15149: crash when printing debug info metadata containing an invalid language spec
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174304 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/DebugInfo.cpp')
-rw-r--r--lib/IR/DebugInfo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp
index c983787712..ecaab1fd65 100644
--- a/lib/IR/DebugInfo.cpp
+++ b/lib/IR/DebugInfo.cpp
@@ -1058,8 +1058,8 @@ void DIScope::printInternal(raw_ostream &OS) const {
void DICompileUnit::printInternal(raw_ostream &OS) const {
DIScope::printInternal(OS);
- if (unsigned Lang = getLanguage())
- OS << " [" << dwarf::LanguageString(Lang) << ']';
+ if (const char *Lang = dwarf::LanguageString(getLanguage()))
+ OS << " [" << Lang << ']';
}
void DIEnumerator::printInternal(raw_ostream &OS) const {