Date: Thu, 1 Jan 2015 22:44:03 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r276516 - head/contrib/llvm/tools/clang/lib/Sema Message-ID: <201501012244.t01Mi3AV001285@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Thu Jan 1 22:44:02 2015 New Revision: 276516 URL: https://svnweb.freebsd.org/changeset/base/276516 Log: Pull in r213790 from upstream clang trunk (by Richard Smith): PR20228: don't retain a pointer to a vector element after the container has been resized. This fixes a possible crash when compiling certain parts of libc++'s type_traits header. Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp Thu Jan 1 22:26:12 2015 (r276515) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp Thu Jan 1 22:44:02 2015 (r276516) @@ -3642,12 +3642,13 @@ static bool evaluateTypeTrait(Sema &S, T if (T->isObjectType() || T->isFunctionType()) T = S.Context.getRValueReferenceType(T); OpaqueArgExprs.push_back( - OpaqueValueExpr(Args[I]->getTypeLoc().getLocStart(), + OpaqueValueExpr(Args[I]->getTypeLoc().getLocStart(), T.getNonLValueExprType(S.Context), Expr::getValueKindForType(T))); - ArgExprs.push_back(&OpaqueArgExprs.back()); } - + for (Expr &E : OpaqueArgExprs) + ArgExprs.push_back(&E); + // Perform the initialization in an unevaluated context within a SFINAE // trap at translation unit scope. EnterExpressionEvaluationContext Unevaluated(S, Sema::Unevaluated);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501012244.t01Mi3AV001285>