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