summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Sedoi <bsnote@gmail.com>2015-02-14 08:51:25 +0200
committerTrevor Norris <trev.norris@gmail.com>2015-02-20 15:25:27 -0700
commit2fc5eeb3da0cbc5c17674818bc679d3d564d0d06 (patch)
treefa26736c4e6ba2ddf8ddec5e62ab1f2b41200b0d
parent9deade432254ebb39a6afb468fad5586d24a5b50 (diff)
downloadnode-2fc5eeb3da0cbc5c17674818bc679d3d564d0d06.tar.gz
deps: backport a02d97e from v8 upstream
Original commit message: Fix --max_old_space_size=4096 integer overflow. BUG=v8:3857 LOG=N Review URL: https://codereview.chromium.org/897543002 Cr-Commit-Position: refs/heads/master@{#26510} PR-URL: https://github.com/joyent/node/pull/9200 Reviewed-by: Trevor Norris <trev.norris@gmail.com> Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
-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 fd08c8292..e65d4459c 100644
--- a/deps/v8/src/heap/heap.cc
+++ b/deps/v8/src/heap/heap.cc
@@ -4828,10 +4828,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.
@@ -4839,10 +4839,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) {