kiszk opened a new pull request #7260:
URL: https://github.com/apache/arrow/pull/7260


   This PR avoids the potential int overflow due to int32 multiplication in 
castDATE_date32().
   
   In 
https://github.com/apache/arrow/blob/master/cpp/src/gandiva/precompiled/time.cc#L461,
 the following code performs the multiplication of two `int32`. The result is 
also `int32`. Then, the result is converted to `int64`.
   
   This code may cause overflow if the result is more than 32-bit. To avoid the 
overflow, this PR pre-casts the constant to `int64`. As a result, the 
multiplication will become `int64` * `int64`.
   ```
   gdv_date64 castDATE_date32(gdv_date32 days) { return days * MILLIS_IN_DAY; }
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to