diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-02-24 17:02:45 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-02-24 17:02:45 +0000 |
commit | 971d31be6f643dd551c8e88fe5989adf98dfe677 (patch) | |
tree | 86fe2349b66648fb749342bb308dc31ffb8f87aa /clang/lib/CodeGen/CGException.cpp | |
parent | dbbaca0e1b5d9a6e36ffdf523c946f02fd6c2357 (diff) | |
download | bcm5719-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.cpp | 4 |
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(); |