Commits


Kazuaki Ishizaki authored and Sutou Kouhei committed 3ac0971b545
ARROW-8924: [C++][Gandiva] Avoid potential int overflow in castDATE_date32() 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 can fix the following failure: ``` The following tests FAILED: 67 - gandiva-date-time-test (Failed) ``` Closes #7260 from kiszk/ARROW-8924 Authored-by: Kazuaki Ishizaki <ishizaki@jp.ibm.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>