File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
lib/SILOptimizer/SILCombiner Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -600,6 +600,8 @@ bool SILCombiner::tryOptimizeInoutKeypath(BeginApplyInst *AI) {
600600 Builder.setInsertionPoint (endApply);
601601 });
602602
603+ invalidatedStackNesting = true ;
604+
603605 eraseInstFromFunction (*endApply);
604606 eraseInstFromFunction (*AI);
605607 ++NumOptimizedKeypaths;
Original file line number Diff line number Diff line change 1+ // RUN: %target-swift-frontend -emit-sil -O -enable-ossa-modules -sil-verify-all %s
2+ // REQUIRES: OS=macosx
3+
4+ import Foundation
5+
6+ // Check the following test does not crash with incorrect stack order
7+ open class DateFormatter {
8+ typealias CFType = CFDateFormatter
9+ open func copy( with zone: NSZone ? = nil ) -> Any {
10+ let copied = DateFormatter ( )
11+
12+ func __copy< T> ( _ keyPath: ReferenceWritableKeyPath < DateFormatter , T > ) {
13+ copied [ keyPath: keyPath] = self [ keyPath: keyPath]
14+ }
15+
16+ __copy ( \. formattingContext)
17+ return copied
18+ }
19+
20+ public enum Context : Int {
21+ case unknown
22+ case dynamic
23+ case standalone
24+ case listItem
25+ case beginningOfSentence
26+ case middleOfSentence
27+ }
28+ open var formattingContext : Context = . unknown
29+ }
30+
You can’t perform that action at this time.
0 commit comments