Skip to content

Commit 1d68b11

Browse files
author
David Ungar
authored
Merge pull request #18153 from davidungar/rdar-42314665-produces-no-output
Don’t dive into null parts of AST.
2 parents 70e2aea + 8c2e96b commit 1d68b11

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/IDE/SourceEntityWalker.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ static SemaReferenceKind getReferenceKind(Expr *Parent, Expr *E) {
246246
}
247247

248248
std::pair<bool, Expr *> SemaAnnotator::walkToExprPre(Expr *E) {
249+
assert(E);
250+
249251
if (isDone())
250252
return { false, nullptr };
251253

@@ -408,11 +410,11 @@ std::pair<bool, Expr *> SemaAnnotator::walkToExprPre(Expr *E) {
408410
llvm::SaveAndRestore<Optional<AccessKind>>
409411
C(this->OpAccess, AccessKind::Write);
410412

411-
if (!AE->getDest()->walk(*this))
413+
if (AE->getDest() && !AE->getDest()->walk(*this))
412414
return { false, nullptr };
413415
}
414416

415-
if (!AE->getSrc()->walk(*this))
417+
if (AE->getSrc() && !AE->getSrc()->walk(*this))
416418
return { false, nullptr };
417419

418420
// We already visited the children.

0 commit comments

Comments
 (0)