$ the-wire · showcase
Swift fixes a silent debug-info bug and a reborrow ordering bug
By RepoJournal · Filed · About Mobile platforms · Composed from the cited sources · methodology
A day of compiler-internal correctness work in swiftlang/swift: two fixes to bugs that quietly produced wrong results, one strict-safety feature gated behind an experimental flag, and two cleanups.
Fix flaky SimplifyCFG.sil apple/swift
The flaky SimplifyCFG.sil test was a symptom, not the disease: SILDIExprElement and SILDebugInfoExpression had an implicit bool conversion and no `==`, so map insertions compared them as bools and treated them as equal whenever both were non-empty. The author notes the behavior was randomized by hash randomization and ASLR on the pointer values involved; the bool conversion is now explicit and ...
LifetimeCompletion: complete nested reborrow scopes in the correct order apple/swift
Lifetime completion walked borrowed_from instructions in reverse instruction order, which does not necessarily match the nesting of reborrow scopes, so the outer scope could be completed before the inner one and yield an end_borrow of the outer scope ahead of the inner's in dead code. Completion now follows the actual scope nesting.
[Sema] A few local discriminator fixes apple/swift
Cached completion no longer re-assigns local discriminators for function parameters, and SILGen now diagnoses a closure discriminator clash instead of silently dropping a body. The change also fixes TopLevelCodeDecl and autoclosure handling in getNextDiscriminator/setMaxAssignedDiscriminator.
[StrictSafety] Gate @unsafe(always) behind an experimental feature apple/swift
AlwaysUnsafeAttribute becomes an experimental feature and the `always` argument of @unsafe is rejected when it is not enabled; the C++ overlay turns it on. Code using @unsafe(always) now needs the feature enabled to compile.
RequirementMachine: Rename RewriteSystem::simplify() to reduce() apple/swift
RequirementMachine renames RewriteSystem::simplify() to reduce() with no functional change, plus a few corrected comments, to head off confusion about what the function does.