Commit 6fff6018 authored by ahaas's avatar ahaas Committed by Commit bot

Use GetCurrentStackPosition() to calculate the stack limit.

The use of the address of a local variable causes problems with asan,
see https://build.chromium.org/p/tryserver.v8/builders/v8_linux64_asan_rel_ng_triggered/builds/7803

R=jochen@chromium.org

Review-Url: https://codereview.chromium.org/2317253006
Cr-Commit-Position: refs/heads/master@{#39330}
parent 2a4b5933
......@@ -63,8 +63,7 @@ void BackgroundParsingTask::Run() {
// Reset the stack limit of the parser to reflect correctly that we're on a
// background thread.
uintptr_t stack_limit =
reinterpret_cast<uintptr_t>(&stack_limit) - stack_size_ * KB;
uintptr_t stack_limit = GetCurrentStackPosition() - stack_size_ * KB;
source_->parser->set_stack_limit(stack_limit);
// Nullify the Isolate temporarily so that the background parser doesn't
......
......@@ -111,8 +111,7 @@ void CompilerDispatcherJob::Parse() {
// use it.
parse_info_->set_isolate(nullptr);
uintptr_t stack_limit =
reinterpret_cast<uintptr_t>(&stack_limit) - max_stack_size_ * KB;
uintptr_t stack_limit = GetCurrentStackPosition() - max_stack_size_ * KB;
parser_->set_stack_limit(stack_limit);
parser_->ParseOnBackground(parse_info_.get());
......@@ -207,8 +206,7 @@ void CompilerDispatcherJob::Compile() {
// Disallowing of handle dereference and heap access dealt with in
// CompilationJob::ExecuteJob.
uintptr_t stack_limit =
reinterpret_cast<uintptr_t>(&stack_limit) - max_stack_size_ * KB;
uintptr_t stack_limit = GetCurrentStackPosition() - max_stack_size_ * KB;
compile_job_->set_stack_limit(stack_limit);
CompilationJob::Status status = compile_job_->ExecuteJob();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment