Commit ef5e7978 authored by Hiroshige Hayashizaki's avatar Hiroshige Hayashizaki Committed by Commit Bot

Check Local<UnboundModuleScript> before producing cache

ProduceCacheInternal()'s |unbount_script| argument can be
empty for module scripts and this is causing crash.

Bug: 938269, 841466
Change-Id: I2e51702fa243c9e1486511ddbe7e845c2b5b4a34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1507112
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638747}
parent f89f75d9
...@@ -213,6 +213,10 @@ static void ProduceCacheInternal( ...@@ -213,6 +213,10 @@ static void ProduceCacheInternal(
V8CodeCache::SetCacheTimeStamp(cache_handler); V8CodeCache::SetCacheTimeStamp(cache_handler);
break; break;
case V8CodeCache::ProduceCacheOptions::kProduceCodeCache: { case V8CodeCache::ProduceCacheOptions::kProduceCodeCache: {
// TODO(crbug.com/938269): Investigate why this can be empty here.
if (unbound_script.IsEmpty())
break;
constexpr const char* kTraceEventCategoryGroup = "v8,devtools.timeline"; constexpr const char* kTraceEventCategoryGroup = "v8,devtools.timeline";
TRACE_EVENT_BEGIN1(kTraceEventCategoryGroup, trace_name, "fileName", TRACE_EVENT_BEGIN1(kTraceEventCategoryGroup, trace_name, "fileName",
source_url.GetString().Utf8()); source_url.GetString().Utf8());
......
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