Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4a61bdb

Browse filesBrowse files
refacktargos
authored andcommitted
deps: V8: fix filename manipulation for Windows
Backport-PR-URL: #28005 PR-URL: #27375 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 018159d commit 4a61bdb
Copy full SHA for 4a61bdb

File tree

Expand file treeCollapse file tree

3 files changed

+11
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+11
-3
lines changed
Open diff view settings
Collapse file

‎common.gypi‎

Copy file name to clipboardExpand all lines: common.gypi
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
# Reset this number to 0 on major V8 upgrades.
4040
# Increment by one for each non-official patch applied to deps/v8.
41-
'v8_embedder_string': '-node.0',
41+
'v8_embedder_string': '-node.1',
4242

4343
##### V8 defaults for Node.js #####
4444

Collapse file

‎deps/v8/src/snapshot/embedded-file-writer.cc‎

Copy file name to clipboardExpand all lines: deps/v8/src/snapshot/embedded-file-writer.cc
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,11 @@ void PlatformDependentEmbeddedFileWriter::DeclareExternalFilename(
819819
// Replace any Windows style paths (backslashes) with forward
820820
// slashes.
821821
std::string fixed_filename(filename);
822-
std::replace(fixed_filename.begin(), fixed_filename.end(), '\\', '/');
822+
for (auto& c : fixed_filename) {
823+
if (c == '\\') {
824+
c = '/';
825+
}
826+
}
823827
fprintf(fp_, ".file %d \"%s\"\n", fileid, fixed_filename.c_str());
824828
}
825829

Collapse file

‎deps/v8/src/torque/csa-generator.cc‎

Copy file name to clipboardExpand all lines: deps/v8/src/torque/csa-generator.cc
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,14 @@ Stack<std::string> CSAGenerator::EmitBlock(const Block* block) {
5656
}
5757

5858
void CSAGenerator::EmitSourcePosition(SourcePosition pos, bool always_emit) {
59-
const std::string& file = SourceFileMap::GetSource(pos.source);
59+
std::string file = SourceFileMap::GetSource(pos.source);
6060
if (always_emit || !previous_position_.CompareStartIgnoreColumn(pos)) {
6161
// Lines in Torque SourcePositions are zero-based, while the
6262
// CodeStubAssembler and downwind systems are one-based.
63+
for (auto& c : file) {
64+
if (c == '\\')
65+
c = '/';
66+
}
6367
out_ << " ca_.SetSourcePosition(\"" << file << "\", "
6468
<< (pos.start.line + 1) << ");\n";
6569
previous_position_ = pos;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.