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

Unified Diff: src/date.cc

Issue 216613003: Don't crash if we get a timezone change notification on an uninitialized isolate (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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/api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/date.cc
diff --git a/src/date.cc b/src/date.cc
index 70d6be989f0509f196cff01450be560fc738e74e..c22bc766734616671803fb30438a40e2ed1ebd7f 100644
--- a/src/date.cc
+++ b/src/date.cc
@@ -49,9 +49,10 @@ static const char kDaysInMonths[] =
void DateCache::ResetDateCache() {
static const int kMaxStamp = Smi::kMaxValue;
- stamp_ = Smi::FromInt(stamp_->value() + 1);
- if (stamp_->value() > kMaxStamp) {
+ if (stamp_->value() >= kMaxStamp) {
stamp_ = Smi::FromInt(0);
+ } else {
+ stamp_ = Smi::FromInt(stamp_->value() + 1);
}
ASSERT(stamp_ != Smi::FromInt(kInvalidStamp));
for (int i = 0; i < kDSTSize; ++i) {
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698