summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-08-25 15:15:12 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-08-25 15:15:12 +0000
commit627cbd31d18207192fa7970d16c63a7d5ab3beae (patch)
treea220f2a1ee725d85bc1353e22771951f516dcbb6 /clang/lib/Sema/SemaExpr.cpp
parent933e23073874138b9aabb866070e2307199dfbf7 (diff)
downloadbcm5719-llvm-627cbd31d18207192fa7970d16c63a7d5ab3beae.tar.gz
bcm5719-llvm-627cbd31d18207192fa7970d16c63a7d5ab3beae.zip
Fix possible crash on null base or type for array elements.
llvm-svn: 245939
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index e1430e3a2ac..f2c0fb82eef 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -3932,7 +3932,8 @@ static bool checkArithmeticOnObjCPointer(Sema &S,
ExprResult
Sema::ActOnArraySubscriptExpr(Scope *S, Expr *base, SourceLocation lbLoc,
Expr *idx, SourceLocation rbLoc) {
- if (base->getType()->isSpecificPlaceholderType(BuiltinType::OMPArraySection))
+ if (base && !base->getType().isNull() &&
+ base->getType()->isSpecificPlaceholderType(BuiltinType::OMPArraySection))
return ActOnOMPArraySectionExpr(base, lbLoc, idx, SourceLocation(),
/*Length=*/nullptr, rbLoc);
OpenPOWER on IntegriCloud