raulcd commented on code in PR #50709:
URL: https://github.com/apache/arrow/pull/50709#discussion_r3773969839
##########
cpp/src/gandiva/gdv_function_stubs.cc:
##########
@@ -611,7 +611,7 @@ const char* gdv_mask_last_n_utf8_int32(int64_t context,
const char* data,
while (bytes_read < data_len) {
auto char_len =
utf8proc_iterate(reinterpret_cast<const utf8proc_uint8_t*>(data +
bytes_read),
- data_len, &utf8_char);
+ data_len - bytes_read, &utf8_char);
Review Comment:
Thanks for the PR! I was going to merge as per @lriggs approval but got a
question, is there any reason we don't check for `char_len < 0` here and in
line 600?
We do seem to be performing that validation on several other
`utf8proc_iterate` generations. If there's a reason maybe it's worth adding a
comment on why. I am not an expert on Gandiva but thought it is worth either
having the check or adding a comment.
--
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]