Skip to content

Commit 8b2bb24

Browse files
Merge remote-tracking branch 'upstream/v14.x-staging' into v14.x-staging
2 parents 3e269f2 + 752817c commit 8b2bb24

File tree

18 files changed

+196
-52
lines changed

18 files changed

+196
-52
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ release.
3030
</tr>
3131
<tr>
3232
<td valign="top">
33-
<b><a href="doc/changelogs/CHANGELOG_V14.md#14.17.1">14.17.1</a></b><br/>
33+
<b><a href="doc/changelogs/CHANGELOG_V14.md#14.17.3">14.17.3</a></b><br/>
34+
<a href="doc/changelogs/CHANGELOG_V14.md#14.17.2">14.17.2</a><br/>
35+
<a href="doc/changelogs/CHANGELOG_V14.md#14.17.1">14.17.1</a><br/>
3436
<a href="doc/changelogs/CHANGELOG_V14.md#14.17.0">14.17.0</a><br/>
3537
<a href="doc/changelogs/CHANGELOG_V14.md#14.16.1">14.16.1</a><br/>
3638
<a href="doc/changelogs/CHANGELOG_V14.md#14.16.0">14.16.0</a><br/>

common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.68',
39+
'v8_embedder_string': '-node.73',
4040

4141
##### V8 defaults for Node.js #####
4242

deps/uv/src/idna.c

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#include "uv.h"
2121
#include "idna.h"
22+
#include <assert.h>
2223
#include <string.h>
2324

2425
static unsigned uv__utf8_decode1_slow(const char** p,
@@ -32,7 +33,7 @@ static unsigned uv__utf8_decode1_slow(const char** p,
3233
if (a > 0xF7)
3334
return -1;
3435

35-
switch (*p - pe) {
36+
switch (pe - *p) {
3637
default:
3738
if (a > 0xEF) {
3839
min = 0x10000;
@@ -62,6 +63,8 @@ static unsigned uv__utf8_decode1_slow(const char** p,
6263
a = 0;
6364
break;
6465
}
66+
/* Fall through. */
67+
case 0:
6568
return -1; /* Invalid continuation byte. */
6669
}
6770

@@ -88,6 +91,8 @@ static unsigned uv__utf8_decode1_slow(const char** p,
8891
unsigned uv__utf8_decode1(const char** p, const char* pe) {
8992
unsigned a;
9093

94+
assert(*p < pe);
95+
9196
a = (unsigned char) *(*p)++;
9297

9398
if (a < 128)
@@ -96,9 +101,6 @@ unsigned uv__utf8_decode1(const char** p, const char* pe) {
96101
return uv__utf8_decode1_slow(p, pe, a);
97102
}
98103

99-
#define foreach_codepoint(c, p, pe) \
100-
for (; (void) (*p <= pe && (c = uv__utf8_decode1(p, pe))), *p <= pe;)
101-
102104
static int uv__idna_toascii_label(const char* s, const char* se,
103105
char** d, char* de) {
104106
static const char alphabet[] = "abcdefghijklmnopqrstuvwxyz0123456789";
@@ -121,25 +123,36 @@ static int uv__idna_toascii_label(const char* s, const char* se,
121123
ss = s;
122124
todo = 0;
123125

124-
foreach_codepoint(c, &s, se) {
126+
/* Note: after this loop we've visited all UTF-8 characters and know
127+
* they're legal so we no longer need to check for decode errors.
128+
*/
129+
while (s < se) {
130+
c = uv__utf8_decode1(&s, se);
131+
132+
if (c == -1u)
133+
return UV_EINVAL;
134+
125135
if (c < 128)
126136
h++;
127-
else if (c == (unsigned) -1)
128-
return UV_EINVAL;
129137
else
130138
todo++;
131139
}
132140

141+
/* Only write "xn--" when there are non-ASCII characters. */
133142
if (todo > 0) {
134143
if (*d < de) *(*d)++ = 'x';
135144
if (*d < de) *(*d)++ = 'n';
136145
if (*d < de) *(*d)++ = '-';
137146
if (*d < de) *(*d)++ = '-';
138147
}
139148

149+
/* Write ASCII characters. */
140150
x = 0;
141151
s = ss;
142-
foreach_codepoint(c, &s, se) {
152+
while (s < se) {
153+
c = uv__utf8_decode1(&s, se);
154+
assert(c != -1u);
155+
143156
if (c > 127)
144157
continue;
145158

@@ -166,10 +179,15 @@ static int uv__idna_toascii_label(const char* s, const char* se,
166179
while (todo > 0) {
167180
m = -1;
168181
s = ss;
169-
foreach_codepoint(c, &s, se)
182+
183+
while (s < se) {
184+
c = uv__utf8_decode1(&s, se);
185+
assert(c != -1u);
186+
170187
if (c >= n)
171188
if (c < m)
172189
m = c;
190+
}
173191

174192
x = m - n;
175193
y = h + 1;
@@ -181,7 +199,10 @@ static int uv__idna_toascii_label(const char* s, const char* se,
181199
n = m;
182200

183201
s = ss;
184-
foreach_codepoint(c, &s, se) {
202+
while (s < se) {
203+
c = uv__utf8_decode1(&s, se);
204+
assert(c != -1u);
205+
185206
if (c < n)
186207
if (++delta == 0)
187208
return UV_E2BIG; /* Overflow. */
@@ -245,8 +266,6 @@ static int uv__idna_toascii_label(const char* s, const char* se,
245266
return 0;
246267
}
247268

248-
#undef foreach_codepoint
249-
250269
long uv__idna_toascii(const char* s, const char* se, char* d, char* de) {
251270
const char* si;
252271
const char* st;
@@ -256,10 +275,14 @@ long uv__idna_toascii(const char* s, const char* se, char* d, char* de) {
256275

257276
ds = d;
258277

259-
for (si = s; si < se; /* empty */) {
278+
si = s;
279+
while (si < se) {
260280
st = si;
261281
c = uv__utf8_decode1(&si, se);
262282

283+
if (c == -1u)
284+
return UV_EINVAL;
285+
263286
if (c != '.')
264287
if (c != 0x3002) /* 。 */
265288
if (c != 0xFF0E) /* . */

deps/uv/test/test-idna.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,25 @@ TEST_IMPL(utf8_decode1) {
9696
return 0;
9797
}
9898

99+
TEST_IMPL(utf8_decode1_overrun) {
100+
const char* p;
101+
char b[1];
102+
103+
/* Single byte. */
104+
p = b;
105+
b[0] = 0x7F;
106+
ASSERT_EQ(0x7F, uv__utf8_decode1(&p, b + 1));
107+
ASSERT_EQ(p, b + 1);
108+
109+
/* Multi-byte. */
110+
p = b;
111+
b[0] = 0xC0;
112+
ASSERT_EQ((unsigned) -1, uv__utf8_decode1(&p, b + 1));
113+
ASSERT_EQ(p, b + 1);
114+
115+
return 0;
116+
}
117+
99118
/* Doesn't work on z/OS because that platform uses EBCDIC, not ASCII. */
100119
#ifndef __MVS__
101120

deps/uv/test/test-list.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ TEST_DECLARE (fork_threadpool_queue_work_simple)
524524

525525
TEST_DECLARE (idna_toascii)
526526
TEST_DECLARE (utf8_decode1)
527+
TEST_DECLARE (utf8_decode1_overrun)
527528
TEST_DECLARE (uname)
528529

529530
TEST_DECLARE (metrics_idle_time)
@@ -1120,6 +1121,7 @@ TASK_LIST_START
11201121
#endif
11211122

11221123
TEST_ENTRY (utf8_decode1)
1124+
TEST_ENTRY (utf8_decode1_overrun)
11231125
TEST_ENTRY (uname)
11241126

11251127
/* Doesn't work on z/OS because that platform uses EBCDIC, not ASCII. */

deps/v8/BUILD.gn

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ v8_toolset_for_shell = "host"
308308
#
309309

310310
config("internal_config_base") {
311-
visibility = [ ":*" ] # Only targets in this file can depend on this.
311+
# Only targets in this file and its subdirs can depend on this.
312+
visibility = [ "./*" ]
312313

313314
configs = [ ":v8_tracing_config" ]
314315

@@ -321,7 +322,8 @@ config("internal_config_base") {
321322

322323
config("internal_config") {
323324
defines = []
324-
visibility = [ ":*" ] # Only targets in this file can depend on this.
325+
# Only targets in this file and its subdirs can depend on this.
326+
visibility = [ "./*" ]
325327

326328
configs = [
327329
"//build/config/compiler:wexit_time_destructors",
@@ -429,7 +431,8 @@ config("v8_header_features") {
429431
# Put defines here that are only used in our internal files and NEVER in
430432
# external headers that embedders (such as chromium and node) might include.
431433
config("features") {
432-
visibility = [ ":*" ] # Only targets in this file can depend on this.
434+
# Only targets in this file and its subdirs can depend on this.
435+
visibility = [ "./*" ]
433436

434437
defines = []
435438

@@ -559,7 +562,8 @@ config("features") {
559562
}
560563

561564
config("toolchain") {
562-
visibility = [ ":*" ] # Only targets in this file can depend on this.
565+
# Only targets in this file and its subdirs can depend on this.
566+
visibility = [ "./*" ]
563567

564568
defines = []
565569
cflags = []

deps/v8/DEPS

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ vars = {
7272

7373
deps = {
7474
'v8/build':
75-
Var('chromium_url') + '/chromium/src/build.git' + '@' + '1b904cc30093c25d5fd48389bd58e3f7409bcf80',
75+
Var('chromium_url') + '/chromium/src/build.git' + '@' + 'c854b8178a7e0a20b168ffded4f2d2cb1e136e42',
7676
'v8/third_party/depot_tools':
77-
Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '454f4ba4b3a69feb03c73f93d789062033433b4c',
77+
Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + 'd4e6fb6573e0955110a2c69be29557f6626d9ae6',
7878
'v8/third_party/icu':
7979
Var('chromium_url') + '/chromium/deps/icu.git' + '@' + 'f2223961702f00a8833874b0560d615a2cc42738',
8080
'v8/third_party/instrumented_libraries':
8181
Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + 'bb3f1802c237dd19105dd0f7919f99e536a39d10',
8282
'v8/buildtools':
83-
Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '204a35a2a64f7179f8b76d7a0385653690839e21',
83+
Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '6302c1175607a436e18947a5abe9df2209e845fc',
8484
'v8/buildtools/clang_format/script':
8585
Var('chromium_url') + '/chromium/llvm-project/cfe/tools/clang-format.git' + '@' + '96636aa0e9f047f17447f2d45a094d0b59ed7917',
8686
'v8/buildtools/linux64': {
@@ -168,7 +168,7 @@ deps = {
168168
'dep_type': 'cipd',
169169
},
170170
'v8/third_party/catapult': {
171-
'url': Var('chromium_url') + '/catapult.git' + '@' + 'e9a8d378c950ee44beec5dd5207e151f48e5b5be',
171+
'url': Var('chromium_url') + '/catapult.git' + '@' + 'f92a7636da65f28dad15bc524e6b681d1c311de0',
172172
'condition': 'checkout_android',
173173
},
174174
'v8/third_party/colorama/src': {
@@ -236,7 +236,7 @@ deps = {
236236
'dep_type': 'cipd',
237237
},
238238
'v8/tools/clang':
239-
Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'de3e20662b84f0ee361a5ae11c99a9513df7c8e8',
239+
Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'c72342ce992ebd9cc02c0d65f0af5941d29eb217',
240240
'v8/tools/luci-go': {
241241
'packages': [
242242
{
@@ -266,7 +266,7 @@ deps = {
266266
'dep_type': 'cipd',
267267
},
268268
'v8/third_party/perfetto':
269-
Var('android_url') + '/platform/external/perfetto.git' + '@' + 'ff70e0d273ed10995866c803f23e11250eb3dc52',
269+
Var('android_url') + '/platform/external/perfetto.git' + '@' + '7cdc44f903d3bcfd1d0f67188bfa797a24756868',
270270
'v8/third_party/protobuf':
271271
Var('chromium_url') + '/external/github.com/google/protobuf'+ '@' + 'b68a347f56137b4b1a746e8c7438495a6ac1bd91',
272272
'v8/third_party/zlib':

deps/v8/gni/proto_library.gni

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ template("proto_library") {
1111
assert(defined(invoker.sources))
1212
proto_sources = invoker.sources
1313

14-
set_sources_assignment_filter([])
15-
1614
if (host_os == "win") {
1715
host_executable_suffix = ".exe"
1816
} else {
@@ -141,6 +139,12 @@ template("proto_library") {
141139
]
142140
}
143141

142+
if (defined(invoker.import_dirs)) {
143+
foreach(path, invoker.import_dirs) {
144+
args += [ "--import-dir=" + rebase_path(path, root_build_dir) ]
145+
}
146+
}
147+
144148
if (generate_with_plugin) {
145149
plugin_path_rebased = rebase_path(plugin_path, root_build_dir)
146150
plugin_out_args = ""
@@ -187,10 +191,7 @@ template("proto_library") {
187191
"visibility",
188192
])
189193

190-
# Exclude the config.descriptor file which is an output for some reason.
191-
set_sources_assignment_filter([ "*.descriptor" ])
192194
sources = get_target_outputs(":$action_name")
193-
set_sources_assignment_filter(sources_assignment_filter)
194195

195196
# configs -= [ "//gn/standalone:extra_warnings" ]
196197
if (defined(invoker.extra_configs)) {

deps/v8/src/base/macros.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,14 +339,14 @@ inline T RoundDown(T x, intptr_t m) {
339339
STATIC_ASSERT(std::is_integral<T>::value);
340340
// m must be a power of two.
341341
DCHECK(m != 0 && ((m & (m - 1)) == 0));
342-
return x & -m;
342+
return x & static_cast<T>(-m);
343343
}
344344
template <intptr_t m, typename T>
345345
constexpr inline T RoundDown(T x) {
346346
STATIC_ASSERT(std::is_integral<T>::value);
347347
// m must be a power of two.
348348
STATIC_ASSERT(m != 0 && ((m & (m - 1)) == 0));
349-
return x & -m;
349+
return x & static_cast<T>(-m);
350350
}
351351

352352
// Return the smallest multiple of m which is >= x.

deps/v8/test/cctest/BUILD.gn

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ v8_header_set("cctest_headers") {
6060
sources = [ "cctest.h" ]
6161
}
6262

63+
config("cctest_sources_config") {
64+
if (is_clang) {
65+
cflags = [ "-Wno-string-concatenation" ]
66+
}
67+
}
68+
6369
v8_source_set("cctest_sources") {
6470
testonly = true
6571

@@ -398,6 +404,7 @@ v8_source_set("cctest_sources") {
398404
"../..:external_config",
399405
"../..:internal_config_base",
400406
"../..:v8_tracing_config",
407+
":cctest_sources_config",
401408
]
402409

403410
public_deps = [

0 commit comments

Comments
 (0)