Compare commits

...

3 Commits

Author SHA1 Message Date
Anders Fugmann
a139a6f5bb 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>
2026-03-12 13:31:47 +01:00
Jeroen Ketema
759c0f5b3d Test 2026-03-12 11:42:51 +01:00
Jeroen Ketema
c9bd100aaf Swift: Disable stack protector pass 2026-03-12 11:37:44 +01:00
2 changed files with 5 additions and 0 deletions

View File

@@ -81,6 +81,9 @@ static void turnOffSilVerifications(swift::SILOptions& options) {
options.VerifyExclusivity = false; options.VerifyExclusivity = false;
options.VerifyNone = true; options.VerifyNone = true;
options.VerifySILOwnership = false; 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); codeql::TrapDomain invocationTrapDomain(codeql::SwiftExtractorState& state);

View File

@@ -187,3 +187,5 @@ func makeTuple<each T>(_ t: repeat each T) -> (repeat each T) {
} }
let _ = makeTuple("A", 2) let _ = makeTuple("A", 2)
//codeql-extractor-options: -disable-stack-protector