Skip to content

Commit 545441e

Browse files
committed
[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
1 parent 590c7cd commit 545441e

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)