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 @@ -4104,14 +4104,20 @@ internal struct ValidatingInstantiateKeyPathBuffer: KeyPathPatternVisitor {
4104
4104
sizeVisitor. finish ( )
4105
4105
instantiateVisitor. finish ( )
4106
4106
isPureStruct. append ( contentsOf: instantiateVisitor. isPureStruct)
4107
- checkSizeConsistency ( )
4107
+ checkSizeConsistency ( checkMaxSize : true )
4108
4108
}
4109
4109
4110
- func checkSizeConsistency( ) {
4110
+ func checkSizeConsistency( checkMaxSize : Bool = false ) {
4111
4111
let nextDest = instantiateVisitor. destData. baseAddress. _unsafelyUnwrappedUnchecked
4112
4112
let curSize = nextDest - origDest + MemoryLayout< Int> . size
4113
4113
4114
- _internalInvariant ( curSize == sizeVisitor. sizeWithMaxSize,
4114
+ let sizeVisitorSize = if checkMaxSize {
4115
+ sizeVisitor. sizeWithMaxSize
4116
+ } else {
4117
+ sizeVisitor. size
4118
+ }
4119
+
4120
+ _internalInvariant ( curSize == sizeVisitorSize,
4115
4121
" size and instantiation visitors out of sync " )
4116
4122
}
4117
4123
}
You can’t perform that action at this time.
0 commit comments