Skip to content

Commit 51d8be5

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 5c8cf9e commit 51d8be5

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
@@ -1349,7 +1349,8 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
13491349
for (; !buf.empty(); buf = buf.substr(info.bytes)) {
13501350
swift::serialization::ExtendedValidationInfo extended_validation_info;
13511351
info = swift::serialization::validateSerializedAST(
1352-
buf, invocation.getSILOptions().EnableOSSAModules, &extended_validation_info);
1352+
buf, invocation.getSILOptions().EnableOSSAModules,
1353+
/*requiredSDK*/StringRef(), &extended_validation_info);
13531354
bool invalid_ast = info.status != swift::serialization::Status::Valid;
13541355
bool invalid_size = (info.bytes == 0) || (info.bytes > buf.size());
13551356
bool invalid_name = info.name.empty();

0 commit comments

Comments
 (0)