aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCStreamer.cpp
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2018-02-20 09:04:13 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2018-02-20 09:04:13 +0000
commit9712113f8ba65a634a02cf863737e2e48a594524 (patch)
tree2084cf6618c1708497c9d5ec80b2e67839c9de48 /llvm/lib/MC/MCStreamer.cpp
parent2cede2e229edfcf5815842d41dec66deb9e100f9 (diff)
downloadllvm-9712113f8ba65a634a02cf863737e2e48a594524.zip
llvm-9712113f8ba65a634a02cf863737e2e48a594524.tar.gz
llvm-9712113f8ba65a634a02cf863737e2e48a594524.tar.bz2
[MC] - Don't crash on unclosed frame.
llvm-mc can crash when there is cfi_startproc without cfi_end_proc: .text .globl foo foo: .cfi_startproc Testcase shows the issue, patch fixes it. Differential revision: https://reviews.llvm.org/D43456 llvm-svn: 325564
Diffstat (limited to 'llvm/lib/MC/MCStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCStreamer.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp
index bc9c93f..a2c58e6 100644
--- a/llvm/lib/MC/MCStreamer.cpp
+++ b/llvm/lib/MC/MCStreamer.cpp
@@ -816,10 +816,11 @@ void MCStreamer::EmitWindowsUnwindTables() {
}
void MCStreamer::Finish() {
- if (!DwarfFrameInfos.empty() && !DwarfFrameInfos.back().End)
- getContext().reportError(SMLoc(), "Unfinished frame!");
- if (!WinFrameInfos.empty() && !WinFrameInfos.back()->End)
+ if ((!DwarfFrameInfos.empty() && !DwarfFrameInfos.back().End) ||
+ (!WinFrameInfos.empty() && !WinFrameInfos.back()->End)) {
getContext().reportError(SMLoc(), "Unfinished frame!");
+ return;
+ }
MCTargetStreamer *TS = getTargetStreamer();
if (TS)