Skip to content

Commit

Permalink
deps: backport a02d97e from v8 upstream
Browse files Browse the repository at this point in the history
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: nodejs/node-v0.x-archive#9200
Reviewed-by: Trevor Norris <[email protected]>
Reviewed-by: Julien Gilli <[email protected]>
  • Loading branch information
bsnote authored and trevnorris committed Feb 20, 2015
1 parent 9deade4 commit 2fc5eeb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions deps/v8/src/heap/heap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4828,21 +4828,22 @@ 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.
if (FLAG_max_semi_space_size > 0) {
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) {
Expand Down

0 comments on commit 2fc5eeb

Please sign in to comment.