[PATCH] D27420: Fix stack-use-after-scope in EvaluateImplicitExceptionSpec

Vitaly Buka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 5 10:21:40 PST 2016


vitalybuka created this revision.
vitalybuka added a reviewer: rsmith.
vitalybuka added subscribers: cfe-commits, aizatsky.

getExceptionSpec returns structure with pointers to temporarily object created
by computeImplicitExceptionSpec.


https://reviews.llvm.org/D27420

Files:
  lib/Sema/SemaDeclCXX.cpp


Index: lib/Sema/SemaDeclCXX.cpp
===================================================================
--- lib/Sema/SemaDeclCXX.cpp
+++ lib/Sema/SemaDeclCXX.cpp
@@ -6100,7 +6100,8 @@
     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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27420.80290.patch
Type: text/x-patch
Size: 506 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161205/8a3295a4/attachment.bin>


More information about the cfe-commits mailing list