Skip to content

Commit 1891c37

Browse files
committed
[lldb] Update use of swift::ser::validateSerializedAST to new API
The Swift service validateSerializedAST now accepts the name of the client SDK to limit loading only swiftmodules built with the same SDK. This prevents loading swiftmodules built with an incompatible SDK where the context is different enough that it can lead to hard compiler crashes. In this use site, loading the swiftmodule from a binary should be safe as the SDK context will be extracted from that swiftmodule. Other imports will use regular loading path and apply the expected restriction. Swift API change: swiftlang/swift#58935
1 parent 6625103 commit 1891c37

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,8 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
13461346
for (; !buf.empty(); buf = buf.substr(info.bytes)) {
13471347
swift::serialization::ExtendedValidationInfo extended_validation_info;
13481348
info = swift::serialization::validateSerializedAST(
1349-
buf, invocation.getSILOptions().EnableOSSAModules, &extended_validation_info);
1349+
buf, invocation.getSILOptions().EnableOSSAModules,
1350+
/*requiredSDK*/StringRef(), &extended_validation_info);
13501351
bool invalid_ast = info.status != swift::serialization::Status::Valid;
13511352
bool invalid_size = (info.bytes == 0) || (info.bytes > buf.size());
13521353
bool invalid_name = info.name.empty();

0 commit comments

Comments
 (0)