Reviewers: bnoordhuis,

Description:
Version 4.1.0.22 (cherry-pick)

Merged a02d97e342b81526ec8ee058dd4d7612a6287d68

Fix --max_old_space_size=4096 integer overflow.

BUG=v8:3857
LOG=N
[email protected]

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

Base URL: https://chromium.googlesource.com/v8/[email protected]

Affected files (+6, -5 lines):
  M include/v8-version.h
  M src/heap/heap.cc


Index: include/v8-version.h
diff --git a/include/v8-version.h b/include/v8-version.h
index ea445413904e41e381d64d0e8c063f16fd31733e..edc4169342f4813571993fe4b138ecc72a348a19 100644
--- a/include/v8-version.h
+++ b/include/v8-version.h
@@ -11,7 +11,7 @@
 #define V8_MAJOR_VERSION 4
 #define V8_MINOR_VERSION 1
 #define V8_BUILD_NUMBER 0
-#define V8_PATCH_LEVEL 21
+#define V8_PATCH_LEVEL 22

 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 0b817e4d6d0c9222539d448ae138529da57d9d9d..8dc77b7accce6c3478c07434a4204ed8fa048498 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -5082,10 +5082,10 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
     max_semi_space_size_ = max_semi_space_size * MB;
   }
   if (max_old_space_size > 0) {
-    max_old_generation_size_ = max_old_space_size * MB;
+ max_old_generation_size_ = static_cast<intptr_t>(max_old_space_size) * MB;
   }
   if (max_executable_size > 0) {
-    max_executable_size_ = max_executable_size * MB;
+    max_executable_size_ = static_cast<intptr_t>(max_executable_size) * MB;
   }

   // If max space size flags are specified overwrite the configuration.
@@ -5093,10 +5093,11 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
     max_semi_space_size_ = FLAG_max_semi_space_size * MB;
   }
   if (FLAG_max_old_space_size > 0) {
-    max_old_generation_size_ = FLAG_max_old_space_size * MB;
+    max_old_generation_size_ =
+        static_cast<intptr_t>(FLAG_max_old_space_size) * MB;
   }
   if (FLAG_max_executable_size > 0) {
-    max_executable_size_ = FLAG_max_executable_size * MB;
+ max_executable_size_ = static_cast<intptr_t>(FLAG_max_executable_size) * MB;
   }

   if (FLAG_stress_compaction) {


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