jpedroantunes commented on a change in pull request #10465:
URL: https://github.com/apache/arrow/pull/10465#discussion_r668904491
##########
File path: cpp/src/gandiva/greedy_dual_size_cache.h
##########
@@ -101,12 +101,16 @@ class GreedyDualSizeCache {
if (size() >= capacity_) {
evict();
}
+ // check and handle possible overflow
+ if (UINT64_MAX - value.cost < inflation_) {
+ overflow();
Review comment:
Even if the inflation is not updated, it is still possible that the
inserted **value.cost + inflation** generates an overflow. This is why we need
to always check it during insertion or get methods
--
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]