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
This commit is contained in:
David Blaikie 2013-02-04 05:31:37 +00:00
parent 6c355ee427
commit a9b1317443

View File

@ -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 {