Jefffrey commented on code in PR #10441:
URL: https://github.com/apache/arrow-rs/pull/10441#discussion_r3661920130
##########
arrow-select/src/take.rs:
##########
@@ -471,7 +471,8 @@ fn take_bits<I: ArrowPrimitiveType>(
let output_slice = output_buffer.as_slice_mut();
nulls.valid_indices().for_each(|idx| {
// SAFETY: idx is a valid index in indices.nulls() -->
idx<indices.len()
- if values.value(unsafe {
indices.value_unchecked(idx).as_usize() }) {
+ // SAFETY: caller guarantees all valid indices are in-bounds
+ if unsafe {
values.value_unchecked(indices.value_unchecked(idx).as_usize()) } {
Review Comment:
im not sure we can do this, since callers can call `take` without an unsafe
block and with check bounds off and pass in an invalid index; this would cause
UB via safe interfaces i believe?
--
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]