mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The access path verification optimizer pass calls `getStaticallyInitializedVariable()`, which was written assuming that the given `SILFunction` would always have a valid return basic block. When the `-unavailable-decl-optimization=stub` option is passed to the frontend, though, any function generated for a declaration marked `@available(*, unavailable)` is rewritten to trap by calling a function that returns `Never`. Therefore the rewritten functions do not have return blocks and passing these functions to `getStaticallyInitializedVariable()` would result in the compiler invoking undefined behavior. Resolves rdar://118281508
7.2 KiB
7.2 KiB