From ffdb307f513c0496d5a4eaf205179e09eb5ac19a Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 5 Dec 2016 18:30:22 +0000 Subject: [PATCH] Fix stack-use-after-scope in EvaluateImplicitExceptionSpec Summary: getExceptionSpec returns structure with pointers to temporarily object created by computeImplicitExceptionSpec. Reviewers: rsmith Subscribers: aizatsky, cfe-commits Differential Revision: https://reviews.llvm.org/D27420 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288685 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDeclCXX.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index c14734182f..f5a2c0dd4d 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -6100,7 +6100,8 @@ void Sema::EvaluateImplicitExceptionSpec(SourceLocation Loc, CXXMethodDecl *MD) return; // Evaluate the exception specification. - auto ESI = computeImplicitExceptionSpec(*this, Loc, MD).getExceptionSpec(); + auto IES = computeImplicitExceptionSpec(*this, Loc, MD); + auto ESI = IES.getExceptionSpec(); // Update the type of the special member to use it. UpdateExceptionSpec(MD, ESI); -- 2.40.0