File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -4108,14 +4108,20 @@ internal struct ValidatingInstantiateKeyPathBuffer: KeyPathPatternVisitor {
4108
4108
sizeVisitor. finish ( )
4109
4109
instantiateVisitor. finish ( )
4110
4110
isPureStruct. append ( contentsOf: instantiateVisitor. isPureStruct)
4111
- checkSizeConsistency ( )
4111
+ checkSizeConsistency ( checkMaxSize : true )
4112
4112
}
4113
4113
4114
- func checkSizeConsistency( ) {
4114
+ func checkSizeConsistency( checkMaxSize : Bool = false ) {
4115
4115
let nextDest = instantiateVisitor. destData. baseAddress. _unsafelyUnwrappedUnchecked
4116
4116
let curSize = nextDest - origDest + MemoryLayout< Int> . size
4117
4117
4118
- _internalInvariant ( curSize == sizeVisitor. sizeWithMaxSize,
4118
+ let sizeVisitorSize = if checkMaxSize {
4119
+ sizeVisitor. sizeWithMaxSize
4120
+ } else {
4121
+ sizeVisitor. size
4122
+ }
4123
+
4124
+ _internalInvariant ( curSize == sizeVisitorSize,
4119
4125
" size and instantiation visitors out of sync " )
4120
4126
}
4121
4127
}
You can’t perform that action at this time.
0 commit comments