diff --git a/base/common/DateLUTImpl.h b/base/common/DateLUTImpl.h index 1a44c670650..8d393465b82 100644 --- a/base/common/DateLUTImpl.h +++ b/base/common/DateLUTImpl.h @@ -1069,11 +1069,11 @@ public: } template - inline LUTIndex addMonthsIndex(DateOrTime v, Int64 delta) const + inline LUTIndex NO_SANITIZE_UNDEFINED addMonthsIndex(DateOrTime v, Int64 delta) const { const Values & values = lut[toLUTIndex(v)]; - Int64 month = values.month + static_cast(delta); /// Cast is to avoid UB in signed integer overflow. + Int64 month = values.month + delta; if (month > 0) {