From 24fdb26f9112b873bc1e6788869fc00735208830 Mon Sep 17 00:00:00 2001 From: Andrew Kaylor Date: Fri, 24 Apr 2015 23:27:32 +0000 Subject: [PATCH] [WinEH] Find correct cloned entry block for outlined handler functions. llvm-svn: 235791 --- lib/CodeGen/WinEHPrepare.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/WinEHPrepare.cpp b/lib/CodeGen/WinEHPrepare.cpp index 1325821d498..20f8acd6328 100644 --- a/lib/CodeGen/WinEHPrepare.cpp +++ b/lib/CodeGen/WinEHPrepare.cpp @@ -1723,7 +1723,8 @@ void WinEHPrepare::mapLandingPadBlocks(LandingPadInst *LPad, // exceptions but code called from catches can. For SEH, it isn't // important if some finally code before a catch-all is executed out of // line or after recovering from the exception. - if (Personality == EHPersonality::MSVC_CXX) + if (Personality == EHPersonality::MSVC_CXX && LPad->isCleanup() && + !Actions->includesCleanup()) findCleanupHandlers(Actions, BB, BB); // Add the catch handler to the action list.