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

llvm-svn: 288685
This commit is contained in:
Vitaly Buka 2016-12-05 18:30:22 +00:00
parent fcd3fa83ea
commit ac10dcc281
1 changed files with 2 additions and 1 deletions

View File

@ -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);