mirror of
https://github.com/apple/swift.git
synced 2026-10-20 19:13:47 +02:00
performLocalReleaseMotion and performLocalRetainMotion handled the *_n entry points with a `break`, which leaves the switch but keeps the scan going, so a release or retain was moved past them as if they didn't touch reference counts. Stop the scan at them instead. Embedded Swift could hit this because its runtime entry points are defined in Swift and visible to LLVM's inliner. Then e.g. swift_bridgeObjectRetain could be inlined into a caller as a call to swift_bridgeObjectRetain_n(p, 1), and a following swift_release(p) could be hoisted above it.