Summary: | Fail early in parseDateFromNullTerminatedCharacters | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Steve VanDeBogart <vandebo> | ||||||||
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | commit-queue, ggaren | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | PC | ||||||||||
OS: | All | ||||||||||
Attachments: |
|
Description
Steve VanDeBogart
2009-11-12 10:03:46 PST
Created attachment 43071 [details]
Only calculate time offsets for valid dates.
Comment on attachment 43071 [details] Only calculate time offsets for valid dates. Thanks for fixing this. > Index: JavaScriptCore/ChangeLog > +2009-11-11 Steve VanDeBogart <vandebo@chromium.org> > + > + Reviewed by NOBODY (OOPS!). > + > + Calculate the time offset only if we were able to parse > + the date string. This saves an IPC in Chromium for > + invalid date strings. Please add a bug link. > Index: JavaScriptCore/wtf/DateMath.cpp > @@ -825,7 +825,7 @@ double parseDateFromNullTerminatedCharac > int offset; > double ms = parseDateFromNullTerminatedCharacters(dateString, haveTZ, offset); > // fall back to local timezone Just do if (isnan(ms)) return NaN; > - if (!haveTZ) { > + if (!haveTZ && ms != NaN) { Also there is another instance to fix in "double parseDateFromNullTerminatedCharacters(ExecState* exec, const char* dateString)" Created attachment 43079 [details]
Other case and early exit
Comment on attachment 43079 [details]
Other case and early exit
spacing
Created attachment 43081 [details]
Fix spacing
Comment on attachment 43081 [details]
Fix spacing
Thanks!
Comment on attachment 43081 [details] Fix spacing Clearing flags on attachment: 43081 Committed r50927: <http://trac.webkit.org/changeset/50927> All reviewed patches have been landed. Closing bug. |