Repository navigation
Conversation
| } | ||
| } | ||
|
|
||
| if (year < 0 || year > (ZEND_LONG_MAX - 1)) { |
There was a problem hiding this comment.
The computation dom = (year + (year/4) - (year/100) + (year/400)) % 7 can still overflow.
Also, year 0 does not exist.
There was a problem hiding this comment.
The double cast is not necessary.
There was a problem hiding this comment.
How did you come to the conclusion to divide by 1.25?
There was a problem hiding this comment.
because year + (year/4) = 1.25*year;
There was a problem hiding this comment.
Ah, and because - (year/100) + (year/400) must be less than 0 this is indeed sufficient of course. This is right.
There was a problem hiding this comment.
(zend_long)max_year can also be UB because it's not necessarily representable?
|
@devnexen This patch will work, I just missed some details sorry. I think however it's nicer if we avoid the double and only use zend_long. |
No description provided.