r288689 - Fix stack-use-after-scope in CheckExplicitlyDefaultedMemberExceptionSpec
Vitaly Buka via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 5 11:25:01 PST 2016
Author: vitalybuka
Date: Mon Dec 5 13:25:00 2016
New Revision: 288689
URL: http://llvm.org/viewvc/llvm-project?rev=288689&view=rev
Log:
Fix stack-use-after-scope in CheckExplicitlyDefaultedMemberExceptionSpec
Summary:
Similar to r288685.
getExceptionSpec returned structure with pointers to temporarily object created
by computeImplicitExceptionSpec.
Reviewers: rsmith
Subscribers: aizatsky, cfe-commits
Differential Revision: https://reviews.llvm.org/D27422
Modified:
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=288689&r1=288688&r2=288689&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Mon Dec 5 13:25:00 2016
@@ -6299,8 +6299,8 @@ void Sema::CheckExplicitlyDefaultedMembe
CallingConv CC = Context.getDefaultCallingConvention(/*IsVariadic=*/false,
/*IsCXXMethod=*/true);
FunctionProtoType::ExtProtoInfo EPI(CC);
- EPI.ExceptionSpec = computeImplicitExceptionSpec(*this, MD->getLocation(), MD)
- .getExceptionSpec();
+ auto IES = computeImplicitExceptionSpec(*this, MD->getLocation(), MD);
+ EPI.ExceptionSpec = IES.getExceptionSpec();
const FunctionProtoType *ImplicitType = cast<FunctionProtoType>(
Context.getFunctionType(Context.VoidTy, None, EPI));
More information about the cfe-commits
mailing list