summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-10-26 12:51:45 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-10-26 12:51:45 +0000
commit3f515cd795872e40bcd84ea42d74ec0e812d939a (patch)
treea7b7f1c6fdb6c904ab4f9fb0f656d72542c82eb5 /clang/lib
parent1408628ffa73b55ade613c22932dd6b15e072559 (diff)
downloadbcm5719-llvm-3f515cd795872e40bcd84ea42d74ec0e812d939a.tar.gz
bcm5719-llvm-3f515cd795872e40bcd84ea42d74ec0e812d939a.zip
Fix use-after-scope in ASTContext.
Extend lifetime of ExceptionTypeStorage, as it is referenced by CanonicalEPI and used outside the block (ExceptionSpec.Exceptions is an ArrayRef) Patch by Sam McCall! Differential Revision: https://reviews.llvm.org/D25983 llvm-svn: 285192
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/ASTContext.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 9faded7dc94..d2c35851ee8 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -3230,13 +3230,13 @@ QualType ASTContext::getFunctionTypeInternal(
for (unsigned i = 0; i != NumArgs; ++i)
CanonicalArgs.push_back(getCanonicalParamType(ArgArray[i]));
+ llvm::SmallVector<QualType, 8> ExceptionTypeStorage;
FunctionProtoType::ExtProtoInfo CanonicalEPI = EPI;
CanonicalEPI.HasTrailingReturn = false;
if (IsCanonicalExceptionSpec) {
// Exception spec is already OK.
} else if (NoexceptInType) {
- llvm::SmallVector<QualType, 8> ExceptionTypeStorage;
switch (EPI.ExceptionSpec.Type) {
case EST_Unparsed: case EST_Unevaluated: case EST_Uninstantiated:
// We don't know yet. It shouldn't matter what we pick here; no-one
OpenPOWER on IntegriCloud