Skip to content

Commit 167cedc

Browse files
committed
[6.0][RemoteInspection] Ignore MetadataSource records with NULL source pointer.
We'd crash on a call to getKind(). Ignore them instead by returning false from isMetadataSourceReady. If this causes getClosureContextInfo to fail to make forward progress, then it will in turn fail and return nullptr to its caller. rdar://126866747 (cherry picked from commit 545441e)
1 parent 60b453c commit 167cedc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/swift/RemoteInspection/ReflectionContext.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,6 +1989,9 @@ class ReflectionContext
19891989
/// \param Builder Used to obtain offsets of elements known so far.
19901990
bool isMetadataSourceReady(const MetadataSource *MS,
19911991
const RecordTypeInfoBuilder &Builder) {
1992+
if (!MS)
1993+
return false;
1994+
19921995
switch (MS->getKind()) {
19931996
case MetadataSourceKind::ClosureBinding:
19941997
return true;

0 commit comments

Comments
 (0)