summaryrefslogtreecommitdiff
path: root/deps
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2015-02-08 23:00:32 -0800
committerBen Noordhuis <info@bnoordhuis.nl>2015-03-17 01:55:50 +0100
commit22793da485517845c028df6f46ed1767cf8bb941 (patch)
tree7f8d59bfdd9c7e503b86ced131bb863c345aa16b /deps
parentb2e00e38dcac23cf564636e8fad880829489286c (diff)
downloadnode-new-22793da485517845c028df6f46ed1767cf8bb941.tar.gz
v8: fix --max_old_space_size=4096 integer overflow
See https://code.google.com/p/v8/issues/detail?id=3857 for the bug report and https://codereview.chromium.org/897543002 for the CL. PR-URL: https://github.com/iojs/io.js/pull/1166 Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'deps')
-rw-r--r--deps/v8/src/heap/heap.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/deps/v8/src/heap/heap.cc b/deps/v8/src/heap/heap.cc
index 0b817e4d6d..8dc77b7acc 100644
--- a/deps/v8/src/heap/heap.cc
+++ b/deps/v8/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) {