File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
stdlib/public/Backtracing Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ struct ArrayImageSource<T>: ImageSource {
42
42
throw ArrayImageSourceError . outOfBoundsRead ( addr, requested)
43
43
}
44
44
45
- buffer. copyBytes ( from: $0 [ Int ( addr) ... ] )
45
+ buffer. copyBytes ( from: $0 [ Int ( addr) ..< Int ( addr + requested ) ] )
46
46
}
47
47
}
48
48
}
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ public class CachingMemoryReader<T: MemoryReader>: MemoryReader {
75
75
let maxBytes = pageSize - offset
76
76
let chunk = min ( remaining, maxBytes)
77
77
78
- buffer [ done..< done+ chunk] . copyBytes ( from: page [ offset... ] )
78
+ buffer [ done..< done+ chunk] . copyBytes ( from: page [ offset..< offset + chunk ] )
79
79
80
80
offset = 0
81
81
done += chunk
Original file line number Diff line number Diff line change @@ -245,8 +245,8 @@ extension MemoryReader {
245
245
throw MemserverError ( message: " Unreadable at \( hex ( addr) ) " )
246
246
}
247
247
248
- if done + Int( reply. len) > bytes . count {
249
- throw MemserverError ( message: " Overrun at \( hex ( addr) ) trying to read \( bytes . count) bytes " )
248
+ if buffer . count - done < Int ( reply. len) {
249
+ throw MemserverError ( message: " Overrun at \( hex ( addr) ) trying to read \( buffer . count) bytes " )
250
250
}
251
251
252
252
let ret = try safeRead ( fd,
You can’t perform that action at this time.
0 commit comments