From a9b1317443990533f56a8420c0fbfb8868dad566 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 4 Feb 2013 05:31:37 +0000 Subject: [PATCH] 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 --- lib/IR/DebugInfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 {