Commit b8664737 authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[compiler] Check correct script type for streamed script

Bug: chromium:1061857
Change-Id: Ib87a18cae343c8861cf49e64923273a43db20960
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2767438Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73712}
parent 73dee8fc
...@@ -3074,6 +3074,7 @@ Compiler::GetSharedFunctionInfoForStreamedScript( ...@@ -3074,6 +3074,7 @@ Compiler::GetSharedFunctionInfoForStreamedScript(
if (maybe_result.is_null()) { if (maybe_result.is_null()) {
// No cache entry found, finalize compilation of the script and add it to // No cache entry found, finalize compilation of the script and add it to
// the isolate cache. // the isolate cache.
DCHECK_EQ(task->flags().is_module(), origin_options.IsModule());
Handle<Script> script; Handle<Script> script;
if (FLAG_finalize_streaming_on_background && !origin_options.IsModule()) { if (FLAG_finalize_streaming_on_background && !origin_options.IsModule()) {
...@@ -3104,8 +3105,8 @@ Compiler::GetSharedFunctionInfoForStreamedScript( ...@@ -3104,8 +3105,8 @@ Compiler::GetSharedFunctionInfoForStreamedScript(
isolate->heap()->SetRootScriptList(*scripts); isolate->heap()->SetRootScriptList(*scripts);
} else { } else {
ParseInfo* parse_info = task->info(); ParseInfo* parse_info = task->info();
DCHECK(parse_info->flags().is_toplevel());
DCHECK_EQ(parse_info->flags().is_module(), origin_options.IsModule()); DCHECK_EQ(parse_info->flags().is_module(), origin_options.IsModule());
DCHECK(parse_info->flags().is_toplevel());
script = parse_info->CreateScript(isolate, source, kNullMaybeHandle, script = parse_info->CreateScript(isolate, source, kNullMaybeHandle,
origin_options); origin_options);
......
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