From 24f07dc6e464aa82694fd3dd5fc88dc139d16b7c Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Tue, 3 Jun 2008 18:14:29 +0000 Subject: [PATCH] Prevent a crash in debug dumps. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51910 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/AsmWriter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index d8372ef0063..9e010051a51 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -979,7 +979,11 @@ void AssemblyWriter::printGlobal(const GlobalVariable *GV) { } void AssemblyWriter::printAlias(const GlobalAlias *GA) { - Out << getLLVMName(GA->getName(), GlobalPrefix) << " = "; + // Don't crash when dumping partially built GA + if (!GA->hasName()) + Out << "<> = "; + else + Out << getLLVMName(GA->getName(), GlobalPrefix) << " = "; switch (GA->getVisibility()) { default: assert(0 && "Invalid visibility style!"); case GlobalValue::DefaultVisibility: break; -- 2.34.1