kawadakk commented on code in PR #4621:
URL: https://github.com/apache/arrow-rs/pull/4621#discussion_r1281540705
##########
arrow-buffer/src/buffer/mutable.rs:
##########
@@ -168,7 +168,18 @@ impl MutableBuffer {
/// `len` of the buffer and so can be used to initialize the memory region
from
/// `len` to `capacity`.
pub fn set_null_bits(&mut self, start: usize, count: usize) {
- assert!(start + count <= self.layout.size());
+ if start
+ .checked_add(count)
Review Comment:
You are right, `self.layout.size()` should never be equal to `usize::MAX`
due to `Layout`'s invariants.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]