Decide on overflow behavior for calendar arithmetic #2151
Labels
C-datetime
Component: datetime, calendars, time zones
good first issue
Good for newcomers
help wanted
Issue needs an assignee
S-medium
Size: Less than a week (larger bug fix or enhancement)
T-bug
Type: Bad behavior, security, privacy
Milestone
There are various places in the calendar code where overflow can occur for very large or small dates. For instance,
It is fairly easy to trigger overflow here because
date.0.year
is ani32
, so if it is larger thani32::MAX / 365
, it will overflow.We have a few options:
i32::MAX
instead of wrapping around.For the purposes of ICU4X 1.0, we can either:
Thoughts?
The text was updated successfully, but these errors were encountered: