Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Fix --max_old_space_size=4096 integer overflow.
Browse files Browse the repository at this point in the history
BUG=v8:3857
LOG=N

Review URL: https://codereview.chromium.org/897543002

Cr-Commit-Position: refs/heads/master@{#26510}
  • Loading branch information
ben authored and Commit bot committed Feb 9, 2015
1 parent 22dd076 commit a02d97e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/heap/heap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5133,21 +5133,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 a02d97e

Please sign in to comment.