File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -2507,7 +2507,7 @@ internal enum KeyPathPatternStoredOffset {
2507
2507
case inline( UInt32 )
2508
2508
case outOfLine( UInt32 )
2509
2509
case unresolvedFieldOffset( UInt32 )
2510
- case unresolvedIndirectOffset( UnsafePointer < UInt32 > )
2510
+ case unresolvedIndirectOffset( UnsafePointer < UInt > )
2511
2511
}
2512
2512
internal struct KeyPathPatternComputedArguments {
2513
2513
var getLayout : KeyPathComputedArgumentLayoutFn
@@ -2602,7 +2602,7 @@ internal func _walkKeyPathPattern<W: KeyPathPatternVisitor>(
2602
2602
as: Int32 . self)
2603
2603
let ptr = _resolveRelativeIndirectableAddress ( base, relativeOffset)
2604
2604
offset = . unresolvedIndirectOffset(
2605
- ptr. assumingMemoryBound ( to: UInt32 . self) )
2605
+ ptr. assumingMemoryBound ( to: UInt . self) )
2606
2606
default :
2607
2607
offset = . inline( header. storedOffsetPayload)
2608
2608
}
@@ -3151,7 +3151,8 @@ internal struct InstantiateKeyPathBuffer : KeyPathPatternVisitor {
3151
3151
case . unresolvedIndirectOffset( let pointerToOffset) :
3152
3152
// Look up offset in the indirectly-referenced variable we have a
3153
3153
// pointer.
3154
- let offset = UInt32 ( pointerToOffset. pointee)
3154
+ assert ( pointerToOffset. pointee <= UInt32 . max)
3155
+ let offset = UInt32 ( truncatingIfNeeded: pointerToOffset. pointee)
3155
3156
let header = RawKeyPathComponent . Header ( storedWithOutOfLineOffset: kind,
3156
3157
mutable: mutable)
3157
3158
pushDest ( header)
You can’t perform that action at this time.
0 commit comments