X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FMC%2FMCStreamer.cpp;h=0fbf3875f1a050a368e5d615835daff5f4c8b3de;hb=6053cd956fa6c781a4ee05cbc99ab15db3cf3d13;hp=5295d0f58f3aa8edec725ef3e87a451c2b169ba7;hpb=49cb9b88867426d1a430f248550d3cc785a68fe4;p=oota-llvm.git diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp index 5295d0f58f3..0fbf3875f1a 100644 --- a/lib/MC/MCStreamer.cpp +++ b/lib/MC/MCStreamer.cpp @@ -22,7 +22,8 @@ using namespace llvm; MCStreamer::MCStreamer(MCContext &Ctx) : Context(Ctx), EmitEHFrame(true), EmitDebugFrame(false), - CurrentW64UnwindInfo(0) { + CurrentW64UnwindInfo(0), + LastSymbol(0) { const MCSection *section = NULL; SectionStack.push_back(std::make_pair(section, section)); } @@ -190,14 +191,14 @@ void MCStreamer::EmitCFIStartProc() { MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo(); if (CurFrame && !CurFrame->End) report_fatal_error("Starting a frame before finishing the previous one!"); - MCDwarfFrameInfo Frame; + MCDwarfFrameInfo Frame; Frame.Function = LastSymbol; // If the function is externally visible, we need to create a local // symbol to avoid relocations. StringRef Prefix = getContext().getAsmInfo().getPrivateGlobalPrefix(); - if (LastSymbol->getName().startswith(Prefix)) { + if (LastSymbol && LastSymbol->getName().startswith(Prefix)) { Frame.Begin = LastSymbol; } else { Frame.Begin = getContext().CreateTempSymbol();