From 2fc5eeb3da0cbc5c17674818bc679d3d564d0d06 Mon Sep 17 00:00:00 2001 From: Andrei Sedoi Date: Sat, 14 Feb 2015 08:51:25 +0200 Subject: [PATCH] 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 Reviewed-by: Julien Gilli --- deps/v8/src/heap/heap.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/deps/v8/src/heap/heap.cc b/deps/v8/src/heap/heap.cc index fd08c8292f8..e65d4459c6b 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(max_old_space_size) * MB; } if (max_executable_size > 0) { - max_executable_size_ = max_executable_size * MB; + max_executable_size_ = static_cast(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(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(FLAG_max_executable_size) * MB; } if (FLAG_stress_compaction) {