Reviewers: danno,

Description:
Merged r20323 into 3.25 branch.

Don't crash if we get a timezone change notification on an uninitialized isolate

BUG=357362
LOG=N
[email protected]

Please review this at https://codereview.chromium.org/212123012/

SVN Base: https://v8.googlecode.com/svn/branches/3.25

Affected files (+5, -3 lines):
  M src/api.cc
  M src/date.cc
  M src/version.cc


Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 2530ac660e1d7d2e76c6c3f373d816364624b12f..303386b3bc432f8d38274ff475d8a393eff09af5 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -5710,6 +5710,7 @@ double v8::Date::ValueOf() const {

 void v8::Date::DateTimeConfigurationChangeNotification(Isolate* isolate) {
   i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
+  if (!i_isolate->IsInitialized()) return;
ON_BAILOUT(i_isolate, "v8::Date::DateTimeConfigurationChangeNotification()",
              return);
   LOG_API(i_isolate, "Date::DateTimeConfigurationChangeNotification");
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) {
Index: src/version.cc
diff --git a/src/version.cc b/src/version.cc
index 9d03d301fb98b69ce4cfbd1b27019214250ec7d4..09594a5004027a58aac3ba84b5590ecf73bbac6a 100644
--- a/src/version.cc
+++ b/src/version.cc
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     25
 #define BUILD_NUMBER      28
-#define PATCH_LEVEL       0
+#define PATCH_LEVEL       1
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to