Skip to content

Commit

Permalink
v8: fix --max_old_space_size=4096 integer overflow
Browse files Browse the repository at this point in the history
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: #1166
Reviewed-By: Fedor Indutny <fedor@indutny.com>
  • Loading branch information
bnoordhuis committed Mar 17, 2015
1 parent b2e00e3 commit 22793da
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 @@ -5082,21 +5082,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 22793da

Please sign in to comment.