[WinEH] Fix two minor issues in __CxxFrameHandler3 tables
authorReid Kleckner <rnk@google.com>
Wed, 7 Oct 2015 17:49:32 +0000 (17:49 +0000)
committerReid Kleckner <rnk@google.com>
Wed, 7 Oct 2015 17:49:32 +0000 (17:49 +0000)
commit5e3eac7a27c0ee53b908d554395eeff7fb5097c3
treecf68993251a7eefd70df396c19f97231dd79817d
parent2ec781c2fef2e3387608ee3afa40fcfaebed2e9c
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249578 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetFrameLowering.h
lib/CodeGen/AsmPrinter/WinException.cpp
lib/CodeGen/PrologEpilogInserter.cpp
test/CodeGen/X86/win-catchpad.ll