File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
SwiftCompilerSources/Sources/Optimizer/Utilities Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ extension ProjectedValue {
104
104
_ context: some Context ) -> V . Result ? {
105
105
var walker = EscapeWalker ( visitor: visitor, complexityBudget: complexityBudget, context)
106
106
if walker. walkUp ( addressOrValue: value, path: path. escapePath) == . abortWalk {
107
+ walker. visitor. cleanupOnAbort ( )
107
108
return nil
108
109
}
109
110
return walker. visitor. result
@@ -119,6 +120,7 @@ extension ProjectedValue {
119
120
_ context: some Context ) -> V . Result ? {
120
121
var walker = EscapeWalker ( visitor: visitor, context)
121
122
if walker. walkDown ( addressOrValue: value, path: path. escapePath) == . abortWalk {
123
+ walker. visitor. cleanupOnAbort ( )
122
124
return nil
123
125
}
124
126
return walker. visitor. result
@@ -182,6 +184,12 @@ extension EscapeVisitor {
182
184
protocol EscapeVisitorWithResult : EscapeVisitor {
183
185
associatedtype Result
184
186
var result : Result { get }
187
+
188
+ mutating func cleanupOnAbort( )
189
+ }
190
+
191
+ extension EscapeVisitorWithResult {
192
+ mutating func cleanupOnAbort( ) { }
185
193
}
186
194
187
195
// FIXME: This ought to be marked private, but that triggers a compiler bug
You can’t perform that action at this time.
0 commit comments