diff options
author | Charles Davis <cdavis@mines.edu> | 2011-05-26 02:45:47 +0000 |
---|---|---|
committer | Charles Davis <cdavis@mines.edu> | 2011-05-26 02:45:47 +0000 |
commit | ca93138e11f404a19553049a569f1fa6ad491b67 (patch) | |
tree | 9885677b07ab9b37121327581d51b57cb4fe635b /lib/MC/MCStreamer.cpp | |
parent | aa4e6afc9be330770e0b5d41e79aa26c3115bcca (diff) |
Test .seh_startchained and .seh_endchained parsing.
Rework how the MCWin64EHUnwindInfo instances are stored. Fix issues with
chained unwind areas exposed by the test that were related to this.
The ChainedParent field had the wrong address, because when the chained unwind
info was added, the addresses shifted around. Now we store the pointers to the
structures, which are now allocated from the MC heap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132106 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCStreamer.cpp')
-rw-r--r-- | lib/MC/MCStreamer.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp index 19aeaafc72..9957a76ba3 100644 --- a/lib/MC/MCStreamer.cpp +++ b/lib/MC/MCStreamer.cpp @@ -307,8 +307,8 @@ void MCStreamer::EmitCFISameValue(int64_t Register) { } void MCStreamer::setCurrentW64UnwindInfo(MCWin64EHUnwindInfo *Frame) { - W64UnwindInfos.push_back(*Frame); - CurrentW64UnwindInfo = &W64UnwindInfos.back(); + W64UnwindInfos.push_back(Frame); + CurrentW64UnwindInfo = W64UnwindInfos.back(); } void MCStreamer::EnsureValidW64UnwindInfo() { @@ -321,11 +321,11 @@ void MCStreamer::EmitWin64EHStartProc(const MCSymbol *Symbol) { MCWin64EHUnwindInfo *CurFrame = CurrentW64UnwindInfo; if (CurFrame && !CurFrame->End) report_fatal_error("Starting a function before ending the previous one!"); - MCWin64EHUnwindInfo Frame; - Frame.Begin = getContext().CreateTempSymbol(); - Frame.Function = Symbol; - EmitLabel(Frame.Begin); - setCurrentW64UnwindInfo(&Frame); + MCWin64EHUnwindInfo *Frame = new (getContext()) MCWin64EHUnwindInfo; + Frame->Begin = getContext().CreateTempSymbol(); + Frame->Function = Symbol; + EmitLabel(Frame->Begin); + setCurrentW64UnwindInfo(Frame); } void MCStreamer::EmitWin64EHEndProc() { @@ -339,13 +339,13 @@ void MCStreamer::EmitWin64EHEndProc() { void MCStreamer::EmitWin64EHStartChained() { EnsureValidW64UnwindInfo(); - MCWin64EHUnwindInfo Frame; + MCWin64EHUnwindInfo *Frame = new (getContext()) MCWin64EHUnwindInfo; MCWin64EHUnwindInfo *CurFrame = CurrentW64UnwindInfo; - Frame.Begin = getContext().CreateTempSymbol(); - Frame.Function = CurFrame->Function; - Frame.ChainedParent = CurFrame; - EmitLabel(Frame.Begin); - setCurrentW64UnwindInfo(&Frame); + Frame->Begin = getContext().CreateTempSymbol(); + Frame->Function = CurFrame->Function; + Frame->ChainedParent = CurFrame; + EmitLabel(Frame->Begin); + setCurrentW64UnwindInfo(Frame); } void MCStreamer::EmitWin64EHEndChained() { |