Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(964)

Unified Diff: src/platform-posix.cc

Issue 160580: Add safe handling of NaN to Posix platform-dependent time functions. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/date-delay.js ('k') | test/mjsunit/regress/regress-416.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-posix.cc
===================================================================
--- src/platform-posix.cc (revision 2614)
+++ src/platform-posix.cc (working copy)
@@ -87,7 +87,7 @@
const char* OS::LocalTimezone(double time) {
- ASSERT(!isnan(time));
+ if (isnan(time)) return "";
time_t tv = static_cast<time_t>(floor(time/msPerSecond));
struct tm* t = localtime(&tv);
if (NULL == t) return "";
@@ -96,7 +96,7 @@
double OS::DaylightSavingsOffset(double time) {
- ASSERT(!isnan(time));
+ if (isnan(time)) return nan_value();
time_t tv = static_cast<time_t>(floor(time/msPerSecond));
struct tm* t = localtime(&tv);
if (NULL == t) return nan_value();
« no previous file with comments | « src/date-delay.js ('k') | test/mjsunit/regress/regress-416.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698