From: David Blaikie Date: Mon, 4 Feb 2013 05:31:37 +0000 (+0000) Subject: PR15149: crash when printing debug info metadata containing an invalid language spec X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a9b1317443990533f56a8420c0fbfb8868dad566;p=oota-llvm.git 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 --- diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index c9837877126..ecaab1fd652 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 {