]> granicus.if.org Git - clang/commitdiff
Fix stack-use-after-scope in CheckExplicitlyDefaultedMemberExceptionSpec
authorVitaly Buka <vitalybuka@google.com>
Mon, 5 Dec 2016 19:25:00 +0000 (19:25 +0000)
committerVitaly Buka <vitalybuka@google.com>
Mon, 5 Dec 2016 19:25:00 +0000 (19:25 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288689 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclCXX.cpp

index f5a2c0dd4dba21b322ba6516460023d7cfadb4c2..6ccb3c5216bfee89d1674cd327f37e9fa77326d9 100644 (file)
@@ -6299,8 +6299,8 @@ void Sema::CheckExplicitlyDefaultedMemberExceptionSpec(
   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));