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) { |