From 33bd2d99d81a08c1fffea4ffb51d692950f0ceae Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 7 Oct 2015 17:49:32 +0000 Subject: [WinEH] Fix two minor issues in __CxxFrameHandler3 tables There was an off-by-one bug in ip2state tables which manifested when one call immediately preceded the try-range of the next. The return address of the previous call would appear to be within the try range of the next scope, resulting in extra destructors or catches running. We also computed the wrong offset for catch parameter stack objects. The offset should be from RSP, not from RBP. llvm-svn: 249578 --- llvm/lib/CodeGen/AsmPrinter/WinException.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/AsmPrinter') diff --git a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp index 4f1d5cb864a..bc2c9ee635c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp @@ -791,7 +791,7 @@ void WinException::computeIP2StateTable( // Emit an entry indicating that PCs after 'Label' have this EH state. if (I.State != LastEHState) IPToStateTable.push_back( - std::make_pair(create32bitRef(I.BeginLabel), I.State)); + std::make_pair(getLabelPlusOne(I.BeginLabel), I.State)); LastEHState = I.State; LastEndLabel = I.EndLabel; } -- cgit v1.2.3