Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 2fc5eeb

Browse files
bsnotetrevnorris
authored andcommitted
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: #9200 Reviewed-by: Trevor Norris <[email protected]> Reviewed-by: Julien Gilli <[email protected]>
1 parent 9deade4 commit 2fc5eeb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

deps/v8/src/heap/heap.cc

+5-4
Original file line numberDiff line numberDiff line change
@@ -4828,21 +4828,22 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
48284828
max_semi_space_size_ = max_semi_space_size * MB;
48294829
}
48304830
if (max_old_space_size > 0) {
4831-
max_old_generation_size_ = max_old_space_size * MB;
4831+
max_old_generation_size_ = static_cast<intptr_t>(max_old_space_size) * MB;
48324832
}
48334833
if (max_executable_size > 0) {
4834-
max_executable_size_ = max_executable_size * MB;
4834+
max_executable_size_ = static_cast<intptr_t>(max_executable_size) * MB;
48354835
}
48364836

48374837
// If max space size flags are specified overwrite the configuration.
48384838
if (FLAG_max_semi_space_size > 0) {
48394839
max_semi_space_size_ = FLAG_max_semi_space_size * MB;
48404840
}
48414841
if (FLAG_max_old_space_size > 0) {
4842-
max_old_generation_size_ = FLAG_max_old_space_size * MB;
4842+
max_old_generation_size_ =
4843+
static_cast<intptr_t>(FLAG_max_old_space_size) * MB;
48434844
}
48444845
if (FLAG_max_executable_size > 0) {
4845-
max_executable_size_ = FLAG_max_executable_size * MB;
4846+
max_executable_size_ = static_cast<intptr_t>(FLAG_max_executable_size) * MB;
48464847
}
48474848

48484849
if (FLAG_stress_compaction) {

0 commit comments

Comments
 (0)