summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGException.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-02-24 17:02:45 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-02-24 17:02:45 +0000
commit971d31be6f643dd551c8e88fe5989adf98dfe677 (patch)
tree86fe2349b66648fb749342bb308dc31ffb8f87aa /clang/lib/CodeGen/CGException.cpp
parentdbbaca0e1b5d9a6e36ffdf523c946f02fd6c2357 (diff)
downloadbcm5719-llvm-971d31be6f643dd551c8e88fe5989adf98dfe677.tar.gz
bcm5719-llvm-971d31be6f643dd551c8e88fe5989adf98dfe677.zip
[WinEH] Make sure terminate handlers have funclet operands
Calls to the terminate handler must be annotated within the exception region they are within. llvm-svn: 261751
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
-rw-r--r--clang/lib/CodeGen/CGException.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index fce2e758196..bf52152237d 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/lib/CodeGen/CGException.cpp
@@ -1326,11 +1326,13 @@ llvm::BasicBlock *CodeGenFunction::getTerminateHandler() {
TerminateHandler = createBasicBlock("terminate.handler");
Builder.SetInsertPoint(TerminateHandler);
llvm::Value *Exn = nullptr;
+ SaveAndRestore<llvm::Instruction *> RestoreCurrentFuncletPad(
+ CurrentFuncletPad);
if (EHPersonality::get(*this).usesFuncletPads()) {
llvm::Value *ParentPad = CurrentFuncletPad;
if (!ParentPad)
ParentPad = llvm::ConstantTokenNone::get(CGM.getLLVMContext());
- Builder.CreateCleanupPad(ParentPad);
+ CurrentFuncletPad = Builder.CreateCleanupPad(ParentPad);
} else {
if (getLangOpts().CPlusPlus)
Exn = getExceptionFromSlot();
OpenPOWER on IntegriCloud