Summary: | Date conversion to local time gets the DST flag wrong for some dates | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | mitz | ||||||||||
Component: | JavaScriptCore | Assignee: | Maciej Stachowiak <mjs> | ||||||||||
Status: | VERIFIED FIXED | ||||||||||||
Severity: | Normal | ||||||||||||
Priority: | P2 | ||||||||||||
Version: | 420+ | ||||||||||||
Hardware: | Mac | ||||||||||||
OS: | OS X 10.4 | ||||||||||||
Attachments: |
|
Description
mitz
2005-10-26 09:58:55 PDT
Created attachment 4484 [details]
Testcase
Mitz mentioned on IRC that eliminating the yearOffset hack fixes this bug. But that would make the code slightly less portable. Created attachment 4506 [details]
Apply the realYearOffset hack only when absolutely necessary
Comment on attachment 4506 [details]
Apply the realYearOffset hack only when absolutely necessary
Haven't tested it on any platform other than PPC OS X.
Comment on attachment 4506 [details]
Apply the realYearOffset hack only when absolutely necessary
This line of code:
+const bool time_tIsSigned = isTime_tSigned();
will result in code run at load time. We don't allow that in JavaScriptCore and
WebCore. We'll need an alternate approach that does the same thing without a
global that requires executing code at library load time.
Created attachment 4510 [details]
Apply the realYearOffset hack only when absolutely necessary
Initialize time_t limits only the first time they're actually needed.
Here's an idea: static bool isTime_tSigned() { time_t minusOne == -1; return minusOne < 0; } (In reply to comment #7) s/==/=/ Comment on attachment 4510 [details]
Apply the realYearOffset hack only when absolutely necessary
Looks good. r=me
(In reply to comment #7) > Here's an idea: > time_t minusOne = -1; Clever! But the above will give a compiler warning if time_t is unsigned. This should work: time_t minusOne = (time_t)(-1); Created attachment 4517 [details]
Better patch
Comment on attachment 4517 [details]
Better patch
Did as Geoffrey suggested
|