From: Douglas Gregor Date: Mon, 1 Nov 2010 21:10:29 +0000 (+0000) Subject: Harden Sema::MaybeBindTotemporary. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19cc1c715e97885f10b3496f91d0a8ae24642faa;p=clang Harden Sema::MaybeBindTotemporary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117954 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 2e5293d84f..63e1a24cfa 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -2933,6 +2933,9 @@ QualType Sema::FindCompositePointerType(SourceLocation Loc, } ExprResult Sema::MaybeBindToTemporary(Expr *E) { + if (!E) + return ExprError(); + if (!Context.getLangOptions().CPlusPlus) return Owned(E);