From 07082096428579009bf20eb276b3e67707a0916d Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sat, 7 Jan 2012 03:13:18 +0000 Subject: Split Finish into Finish and FinishImpl to have a common place to do end of file error checking. Use that to error on an unfinished cfi_startproc. The error is not nice, but is already better than a segmentation fault. llvm-svn: 147717 --- llvm/lib/MC/MCStreamer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm/lib/MC/MCStreamer.cpp') diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp index 8567941c45a..ce9de9d4c51 100644 --- a/llvm/lib/MC/MCStreamer.cpp +++ b/llvm/lib/MC/MCStreamer.cpp @@ -652,3 +652,10 @@ void MCStreamer::EmitW64Tables() { MCWin64EHUnwindEmitter::Emit(*this); } + +void MCStreamer::Finish() { + if (!FrameInfos.empty() && !FrameInfos.back().End) + report_fatal_error("Unfinished frame!"); + + FinishImpl(); +} -- cgit v1.2.3