From 19cc1c715e97885f10b3496f91d0a8ae24642faa Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 1 Nov 2010 21:10:29 +0000 Subject: [PATCH] Harden Sema::MaybeBindTotemporary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117954 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaExprCXX.cpp | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.40.0