mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
[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
This commit is contained in:
parent
a78ed93af4
commit
fdb04128c9
@ -816,10 +816,11 @@ void MCStreamer::EmitWindowsUnwindTables() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MCStreamer::Finish() {
|
void MCStreamer::Finish() {
|
||||||
if (!DwarfFrameInfos.empty() && !DwarfFrameInfos.back().End)
|
if ((!DwarfFrameInfos.empty() && !DwarfFrameInfos.back().End) ||
|
||||||
getContext().reportError(SMLoc(), "Unfinished frame!");
|
(!WinFrameInfos.empty() && !WinFrameInfos.back()->End)) {
|
||||||
if (!WinFrameInfos.empty() && !WinFrameInfos.back()->End)
|
|
||||||
getContext().reportError(SMLoc(), "Unfinished frame!");
|
getContext().reportError(SMLoc(), "Unfinished frame!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
MCTargetStreamer *TS = getTargetStreamer();
|
MCTargetStreamer *TS = getTargetStreamer();
|
||||||
if (TS)
|
if (TS)
|
||||||
|
10
test/MC/X86/cfi-scope-unclosed.s
Normal file
10
test/MC/X86/cfi-scope-unclosed.s
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# RUN: not llvm-mc %s -filetype=obj -triple=x86_64-unknown-linux \
|
||||||
|
# RUN: -o /dev/null 2>&1 | FileCheck %s
|
||||||
|
|
||||||
|
## Check we don't crash on unclosed frame scope.
|
||||||
|
# CHECK: error: Unfinished frame!
|
||||||
|
|
||||||
|
.text
|
||||||
|
.globl foo
|
||||||
|
foo:
|
||||||
|
.cfi_startproc
|
Loading…
Reference in New Issue
Block a user