Skip to content

Commit 5d684fb

Browse files
authored
Merge pull request swiftlang#63320 from bnbarham/index-objc-impl-crash
[AST] Avoid possible segfault in isDirectToStorageAccess
2 parents 47c3ef5 + 526016c commit 5d684fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/AST/Decl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2165,7 +2165,7 @@ static bool isDirectToStorageAccess(const DeclContext *UseDC,
21652165
if (!var->hasStorage())
21662166
return false;
21672167

2168-
auto *AFD = dyn_cast<AbstractFunctionDecl>(UseDC);
2168+
auto *AFD = dyn_cast_or_null<AbstractFunctionDecl>(UseDC);
21692169
if (AFD == nullptr)
21702170
return false;
21712171

0 commit comments

Comments
 (0)