Don't emit .seh_handler directives for any cleanup funclets
authorReid Kleckner <rnk@google.com>
Thu, 8 Dec 2016 20:38:46 +0000 (20:38 +0000)
committerReid Kleckner <rnk@google.com>
Thu, 8 Dec 2016 20:38:46 +0000 (20:38 +0000)
commit785e7d282c9b2835c330b57c32676448e38887b8
treefe6e438602a642d164b04716fa4d857cfd24fb77
parentb5cd6e7b7ec244d8f8f4fdfd1f802e42ff48c34b
Don't emit .seh_handler directives for any cleanup funclets

We were falsely claiming that we had an LSDA for the relevant EH
personality before this change, which could lead to the EH machinery
interpreting random adjacent data as an LSDA.

Fixes PR31317

This change is safe because cleanups can't contain exception handlers
today. We do these things to maintain that invariant:
- C++ destructors are naturally out-of-line
- __finally blocks are outlined in clang
- LLVM's inliner will not inline EH constructs into cleanups

llvm-svn: 289101
llvm/lib/CodeGen/AsmPrinter/WinException.cpp
llvm/test/CodeGen/X86/seh-catchpad.ll