mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
RangeInfo: fix a crash when a var decl doesn't have a patternbindingdecl as parent. (#8255)
This commit is contained in:
@@ -661,7 +661,8 @@ public:
|
||||
case RangeMatchKind::NoneMatch:
|
||||
// PatternBindingDecl is not visited; we need to explicitly analyze here.
|
||||
if (auto *VA = dyn_cast_or_null<VarDecl>(D))
|
||||
analyze(VA->getParentPatternBinding());
|
||||
if (auto PBD = VA->getParentPatternBinding())
|
||||
analyze(PBD);
|
||||
break;
|
||||
case RangeMatchKind::RangeMatch: {
|
||||
postAnalysis(Node);
|
||||
|
||||
Reference in New Issue
Block a user