Files
swift-mirror/lib/SIL/IR/SILGlobalVariable.cpp
Allan Shortlidge da3af768e6 SIL: Fix a crash during access path verification.
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
2023-11-12 09:47:49 -08:00

7.2 KiB