From 964bf8a1c40a510a536bba239a0324015f30e523 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 5 Dec 2016 19:25:00 +0000 Subject: [PATCH] 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288689 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDeclCXX.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index f5a2c0dd4d..6ccb3c5216 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -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( Context.getFunctionType(Context.VoidTy, None, EPI)); -- 2.40.0