Message236993
| Author |
belopolsky |
| Recipients |
BreamoreBoy, belopolsky, flox, python-dev |
| Date |
2015年03月01日.22:30:58 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1425249058.26.0.276403152484.issue13312@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
We still have the following in Lib/test/test_time.py:
# Issue #13312: it may return wrong value for year < TIME_MINYEAR + 1900
# Skip the value test, but check that no error is raised
self.yearstr(TIME_MINYEAR)
I reviewed the current time.asctime() code and it does look like it invokes undefined behavior for extremely large negative years.
The problem is that in C struct tm, year is stored as year - 1900 and for year < -2147481748 (= -2**31 + 1900) we trigger an overflow of a signed integer.
Can someone confirm that on AMD64 FreeBSD subtracting 1900 from -2147483648 and then adding it back does not give -2147483648? |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2015年03月01日 22:30:58 | belopolsky | set | recipients:
+ belopolsky, flox, BreamoreBoy, python-dev |
| 2015年03月01日 22:30:58 | belopolsky | set | messageid: <1425249058.26.0.276403152484.issue13312@psf.upfronthosting.co.za> |
| 2015年03月01日 22:30:58 | belopolsky | link | issue13312 messages |
| 2015年03月01日 22:30:58 | belopolsky | create |
|