Files
swift-mirror/lib/SILOptimizer/IPO/ClosureSpecializer.cpp
Nate Chandler 6191de6862 [ClosureSpecializer] Don't release trivial noescape apply arg twice.
When a specialization is created, in the original function, releases are
added in two different places:
(1) `ClosureSpecCloner::populateCloned`
(2) `rewriteApplyInst`

In the former, releases are added for closures which are guaranteed or
trivial noescape (but with owned convention).
In the latter, releases are added for closures that are owned.

Previously, when emitting releases at (2), whether the closure was
trivial noescape wasn't considered.  The result was inserting the
releases twice, an overrelease.

Here, fix (2) to recognize trivial noescape as not +1.

rdar://110115795
2023-06-01 08:35:20 -07:00

59 KiB