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 @@ -4048,14 +4048,20 @@ internal struct ValidatingInstantiateKeyPathBuffer: KeyPathPatternVisitor {
4048
4048
sizeVisitor. finish ( )
4049
4049
instantiateVisitor. finish ( )
4050
4050
isPureStruct. append ( contentsOf: instantiateVisitor. isPureStruct)
4051
- checkSizeConsistency ( )
4051
+ checkSizeConsistency ( checkMaxSize : true )
4052
4052
}
4053
4053
4054
- func checkSizeConsistency( ) {
4054
+ func checkSizeConsistency( checkMaxSize : Bool = false ) {
4055
4055
let nextDest = instantiateVisitor. destData. baseAddress. _unsafelyUnwrappedUnchecked
4056
4056
let curSize = nextDest - origDest + MemoryLayout< Int> . size
4057
4057
4058
- _internalInvariant ( curSize == sizeVisitor. sizeWithMaxSize,
4058
+ let sizeVisitorSize = if checkMaxSize {
4059
+ sizeVisitor. sizeWithMaxSize
4060
+ } else {
4061
+ sizeVisitor. size
4062
+ }
4063
+
4064
+ _internalInvariant ( curSize == sizeVisitorSize,
4059
4065
" size and instantiation visitors out of sync " )
4060
4066
}
4061
4067
}
You can’t perform that action at this time.
0 commit comments