Skip to content

Commit f6996ee

Browse files
richardlaunodejs-github-bot
authored andcommitted
deps: V8: backport c4be0a97f981
Original commit message: Fix build with gcc12 - A number of erroneous flags have been added to BUILD.gn - wasm-init-expr.cc is creating an 8 byte buffer witch may be much smaller than max size_t output. We also need to make room for the `f` character and the terminating null character - inspector_protocol currently generates the following error ``` error: loop variable ‘json_in’ of type ‘const std::string&’ {aka ‘const std::__cxx11::basic_string<char>&’} binds to a temporary constructed from type ‘const char* const’ ``` Change-Id: I1139899b2664e47d01ebc44f2e972fc4c0ec212d Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5331756 Reviewed-by: Matthias Liedtke <mliedtke@chromium.org> Commit-Queue: Milad Farazmand <mfarazma@redhat.com> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Cr-Commit-Position: refs/heads/main@{#92615} Refs: v8/v8@c4be0a9 PR-URL: #52183 Refs: v8/v8@f8d5e57 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 0d4bc4c commit f6996ee

File tree

6 files changed

+44
-22
lines changed

6 files changed

+44
-22
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
# Reset this number to 0 on major V8 upgrades.
3939
# Increment by one for each non-official patch applied to deps/v8.
40-
'v8_embedder_string': '-node.14',
40+
'v8_embedder_string': '-node.15',
4141

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

deps/v8/BUILD.gn

+14
Original file line numberDiff line numberDiff line change
@@ -1668,6 +1668,20 @@ config("toolchain") {
16681668
# Fix build with older versions of GCC
16691669
# Ported from v8 bazel: https://crrev.com/c/3368869
16701670
"-Wno-stringop-overflow",
1671+
1672+
# Fix a number of bogus errors with gcc12
1673+
# TODO(miladfarca): re-evaluate for future gcc upgrades
1674+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111499
1675+
"-Wno-stringop-overread",
1676+
1677+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104336
1678+
"-Wno-restrict",
1679+
1680+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
1681+
"-Wno-array-bounds",
1682+
1683+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108517
1684+
"-Wno-nonnull",
16711685
]
16721686
}
16731687

deps/v8/src/d8/d8.cc

+2
Original file line numberDiff line numberDiff line change
@@ -4022,7 +4022,9 @@ V8_NOINLINE void FuzzerMonitor::UseAfterFree() {
40224022
// Use-after-free caught by ASAN.
40234023
std::vector<bool>* storage = new std::vector<bool>(3);
40244024
delete storage;
4025+
#if defined(__clang__)
40254026
USE(storage->at(1));
4027+
#endif
40264028
}
40274029

40284030
V8_NOINLINE void FuzzerMonitor::UseOfUninitializedValue() {

deps/v8/src/wasm/function-compiler.cc

+6-3
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ WasmCompilationResult WasmCompilationUnit::ExecuteFunctionCompilation(
110110
case ExecutionTier::kNone:
111111
UNREACHABLE();
112112

113-
case ExecutionTier::kLiftoff:
113+
case ExecutionTier::kLiftoff: {
114114
// The --wasm-tier-mask-for-testing flag can force functions to be
115115
// compiled with TurboFan, and the --wasm-debug-mask-for-testing can force
116116
// them to be compiled for debugging, see documentation.
@@ -144,8 +144,8 @@ WasmCompilationResult WasmCompilationUnit::ExecuteFunctionCompilation(
144144
// TODO(wasm): We could actually stop or remove the tiering unit for this
145145
// function to avoid compiling it twice with TurboFan.
146146
V8_FALLTHROUGH;
147-
148-
case ExecutionTier::kTurbofan:
147+
}
148+
case ExecutionTier::kTurbofan: {
149149
compiler::WasmCompilationData data(func_body);
150150
data.func_index = func_index_;
151151
data.wire_bytes_storage = wire_bytes_storage;
@@ -165,6 +165,9 @@ WasmCompilationResult WasmCompilationUnit::ExecuteFunctionCompilation(
165165
detected);
166166
result.for_debugging = for_debugging_;
167167
break;
168+
}
169+
default:
170+
UNREACHABLE();
168171
}
169172

170173
DCHECK(result.succeeded());

deps/v8/third_party/inspector_protocol/crdtp/dispatch_test.cc

+11-9
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,11 @@ TEST(DispatchableTest, MessageWithUnknownProperty) {
169169
}
170170

171171
TEST(DispatchableTest, DuplicateMapKey) {
172-
for (const std::string& json :
173-
{"{\"id\":42,\"id\":42}", "{\"params\":null,\"params\":null}",
174-
"{\"method\":\"foo\",\"method\":\"foo\"}",
175-
"{\"sessionId\":\"42\",\"sessionId\":\"42\"}"}) {
172+
const std::array<std::string, 4> jsons = {
173+
{"{\"id\":42,\"id\":42}", "{\"params\":null,\"params\":null}",
174+
"{\"method\":\"foo\",\"method\":\"foo\"}",
175+
"{\"sessionId\":\"42\",\"sessionId\":\"42\"}"}};
176+
for (const std::string& json : jsons) {
176177
SCOPED_TRACE("json = " + json);
177178
std::vector<uint8_t> cbor;
178179
ASSERT_TRUE(json::ConvertJSONToCBOR(SpanFrom(json), &cbor).ok());
@@ -185,11 +186,12 @@ TEST(DispatchableTest, DuplicateMapKey) {
185186
}
186187

187188
TEST(DispatchableTest, ValidMessageParsesOK_NoParams) {
188-
for (const std::string& json :
189-
{"{\"id\":42,\"method\":\"Foo.executeBar\",\"sessionId\":"
190-
"\"f421ssvaz4\"}",
191-
"{\"id\":42,\"method\":\"Foo.executeBar\",\"sessionId\":\"f421ssvaz4\","
192-
"\"params\":null}"}) {
189+
const std::array<std::string, 2> jsons = {
190+
{"{\"id\":42,\"method\":\"Foo.executeBar\",\"sessionId\":"
191+
"\"f421ssvaz4\"}",
192+
"{\"id\":42,\"method\":\"Foo.executeBar\",\"sessionId\":\"f421ssvaz4\","
193+
"\"params\":null}"}};
194+
for (const std::string& json : jsons) {
193195
SCOPED_TRACE("json = " + json);
194196
std::vector<uint8_t> cbor;
195197
ASSERT_TRUE(json::ConvertJSONToCBOR(SpanFrom(json), &cbor).ok());

deps/v8/third_party/inspector_protocol/crdtp/json_test.cc

+10-9
Original file line numberDiff line numberDiff line change
@@ -704,15 +704,16 @@ using ContainerTestTypes = ::testing::Types<std::vector<uint8_t>, std::string>;
704704
TYPED_TEST_SUITE(ConvertJSONToCBORTest, ContainerTestTypes);
705705

706706
TYPED_TEST(ConvertJSONToCBORTest, RoundTripValidJson) {
707-
for (const std::string& json_in : {
708-
"{\"msg\":\"Hello, world.\",\"lst\":[1,2,3]}",
709-
"3.1415",
710-
"false",
711-
"true",
712-
"\"Hello, world.\"",
713-
"[1,2,3]",
714-
"[]",
715-
}) {
707+
const std::array<std::string, 7> jsons = {{
708+
"{\"msg\":\"Hello, world.\",\"lst\":[1,2,3]}",
709+
"3.1415",
710+
"false",
711+
"true",
712+
"\"Hello, world.\"",
713+
"[1,2,3]",
714+
"[]",
715+
}};
716+
for (const std::string& json_in : jsons) {
716717
SCOPED_TRACE(json_in);
717718
TypeParam json(json_in.begin(), json_in.end());
718719
std::vector<uint8_t> cbor;

0 commit comments

Comments
 (0)