Weijun-H commented on code in PR #4148:
URL: https://github.com/apache/arrow-rs/pull/4148#discussion_r1180185165
##########
arrow-arith/src/bitwise.rs:
##########
@@ -143,6 +177,24 @@ mod tests {
Ok(())
}
+ #[test]
Review Comment:
> Shift operations (<<, >>) on a value of width N can be passed a shift
value >= N. It is unclear what behaviour should result from this, so the shift
value is unconditionally masked to be modulo N to ensure that the argument is
always in range.
I found the reason here
https://github.com/rust-lang/rfcs/blob/master/text/0560-integer-overflow.md
##########
arrow-arith/src/bitwise.rs:
##########
@@ -143,6 +177,24 @@ mod tests {
Ok(())
}
+ #[test]
Review Comment:
> Shift operations (<<, >>) on a value of width N can be passed a shift
value >= N. It is unclear what behaviour should result from this, so the shift
value is unconditionally masked to be modulo N to ensure that the argument is
always in range.
I found the reason here
https://github.com/rust-lang/rfcs/blob/master/text/0560-integer-overflow.md
--
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]