Swift: disable stack protection in extractor to fix Linux crash

The FunctionStackProtection SIL pass crashes on Linux when processing
standard library functions like withUnsafePointer(to:_:). This is a
known upstream Swift compiler bug (swiftlang/swift#69768).

The extractor does not need stack protection since it only extracts
semantic information from the AST and never produces executable code.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Anders Fugmann
2026-03-12 13:31:47 +01:00
parent 759c0f5b3d
commit a139a6f5bb

View File

@@ -81,6 +81,9 @@ static void turnOffSilVerifications(swift::SILOptions& options) {
options.VerifyExclusivity = false;
options.VerifyNone = true;
options.VerifySILOwnership = false;
// Stack protection is not needed for extraction and causes a crash on Linux
// (https://github.com/swiftlang/swift/issues/69768)
options.EnableStackProtection = false;
}
codeql::TrapDomain invocationTrapDomain(codeql::SwiftExtractorState& state);