Skip to content

Commit 2679ea1

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 9fde71b commit 2679ea1

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

0 commit comments

Comments
 (0)