mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
IDETool: Register SourceFile for replaced function body.
This prevents a nullptr dereference in `ASTScope::unqualifiedLookup()` after querying for the `SourceFile` containing a give source location. Fixes rdar://137652856 and https://github.com/swiftlang/swift/issues/76944.
This commit is contained in:
@@ -354,6 +354,7 @@ bool IDEInspectionInstance::performCachedOperationIfPossible(
|
||||
nullptr
|
||||
}
|
||||
);
|
||||
SM.recordSourceFile(newBufferID, AFD->getParentSourceFile());
|
||||
|
||||
AFD->setBodyToBeReparsed(newBodyRange);
|
||||
oldSF->clearScope();
|
||||
|
||||
Reference in New Issue
Block a user