aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-05-07 21:01:17 +0000
committerJohn McCall <rjmccall@apple.com>2010-05-07 21:01:17 +0000
commitce87e6d501e4c924f246d2ebf82d780690589351 (patch)
tree401295d2318436e8e2e4e1eba85dc016dea17333 /lib/AST/ExprConstant.cpp
parentefdb83e26f9a1fd2566afe54461216cd84814d42 (diff)
Fix a potential null dereference in the pointer-to-bool evaluator; caught by
Eli Friedman. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103297 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r--lib/AST/ExprConstant.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index b6613e7cdc..c534d03a5e 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -115,7 +115,7 @@ static bool EvalPointerValueAsBool(LValue& Value, bool& Result) {
Result = Base || !Value.Offset.isZero();
- const DeclRefExpr* DeclRef = dyn_cast<DeclRefExpr>(Base);
+ const DeclRefExpr* DeclRef = dyn_cast_or_null<DeclRefExpr>(Base);
if (!DeclRef)
return true;