summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2018-02-06 02:58:21 +0000
committerRichard Trieu <rtrieu@google.com>2018-02-06 02:58:21 +0000
commit2bf6c058a122c869e48fc0d4de40af73ac007fd1 (patch)
tree207e6ce5777e645ca7746dfb34a062e0402d06e1 /clang/lib/Sema/SemaExpr.cpp
parent0fc039df1e287b5c5493484966fe0cb03d259404 (diff)
downloadbcm5719-llvm-2bf6c058a122c869e48fc0d4de40af73ac007fd1.tar.gz
bcm5719-llvm-2bf6c058a122c869e48fc0d4de40af73ac007fd1.zip
Fix crash on invalid.
Don't call a method when the pointer is null. llvm-svn: 324308
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 23b3a0ccebf..54723369002 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -14958,7 +14958,8 @@ static void DoMarkVarDeclReferenced(Sema &SemaRef, SourceLocation Loc,
if (RefersToEnclosingScope) {
LambdaScopeInfo *const LSI =
SemaRef.getCurLambda(/*IgnoreNonLambdaCapturingScope=*/true);
- if (LSI && !LSI->CallOperator->Encloses(Var->getDeclContext())) {
+ if (LSI && (!LSI->CallOperator ||
+ !LSI->CallOperator->Encloses(Var->getDeclContext()))) {
// If a variable could potentially be odr-used, defer marking it so
// until we finish analyzing the full expression for any
// lvalue-to-rvalue
OpenPOWER on IntegriCloud