Commit a36354c2 authored by Adam Klein's avatar Adam Klein Committed by Commit Bot

[d8] Always pass filename through NormalizePath for dynamic imports

d8's fragile path manipulation code requires that backslashes are
replaced with slashes before further processing. NormalizePath() is
the function that does this, and it's called in almost all the
required cases. But because of Clusterfuzz runs tests with
an absolute URL on the commandline, there was one case that
slipped through. This patch closes that gap.

No test added since this only reproduces under Clusterfuzz, not
in running mjsunit tests.

Bug: chromium:784012
Change-Id: Ie699e93ff1acb79edfe25ce59d576e9f7bd8c022
Reviewed-on: https://chromium-review.googlesource.com/912325Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51224}
parent 855cb90d
......@@ -957,9 +957,7 @@ void Shell::DoHostImportModuleDynamically(void* import_data) {
std::string source_url = ToSTLString(isolate, referrer);
std::string dir_name =
DirName(IsAbsolutePath(source_url)
? source_url
: NormalizePath(source_url, GetWorkingDirectory()));
DirName(NormalizePath(source_url, GetWorkingDirectory()));
std::string file_name = ToSTLString(isolate, specifier);
std::string absolute_path = NormalizePath(file_name, dir_name);
......
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