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 {
41084108 sizeVisitor. finish ( )
41094109 instantiateVisitor. finish ( )
41104110 isPureStruct. append ( contentsOf: instantiateVisitor. isPureStruct)
4111- checkSizeConsistency ( )
4111+ checkSizeConsistency ( checkMaxSize : true )
41124112 }
41134113
4114- func checkSizeConsistency( ) {
4114+ func checkSizeConsistency( checkMaxSize : Bool = false ) {
41154115 let nextDest = instantiateVisitor. destData. baseAddress. _unsafelyUnwrappedUnchecked
41164116 let curSize = nextDest - origDest + MemoryLayout< Int> . size
41174117
4118- _internalInvariant ( curSize == sizeVisitor. sizeWithMaxSize,
4118+ let sizeVisitorSize = if checkMaxSize {
4119+ sizeVisitor. sizeWithMaxSize
4120+ } else {
4121+ sizeVisitor. size
4122+ }
4123+
4124+ _internalInvariant ( curSize == sizeVisitorSize,
41194125 " size and instantiation visitors out of sync " )
41204126 }
41214127}
You can’t perform that action at this time.
0 commit comments