diff options
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index 07684f9..3cff635 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -974,9 +974,15 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) { address = CreateTempAlloca(allocaTy, allocaAlignment); address.getPointer()->setName(D.getName()); + // Don't emit lifetime markers for MSVC catch parameters. The lifetime of + // the catch parameter starts in the catchpad instruction, and we can't + // insert code in those basic blocks. + bool IsMSCatchParam = + D.isExceptionVariable() && getTarget().getCXXABI().isMicrosoft(); + // Emit a lifetime intrinsic if meaningful. There's no point // in doing this if we don't have a valid insertion point (?). - if (HaveInsertPoint()) { + if (HaveInsertPoint() && !IsMSCatchParam) { uint64_t size = CGM.getDataLayout().getTypeAllocSize(allocaTy); emission.SizeForLifetimeMarkers = EmitLifetimeStart(size, address.getPointer()); |