Skip to content

Commit 021b0b7

Browse files
richardlaumarco-ippolito
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> PR-URL: #52293 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
1 parent 681aaf8 commit 021b0b7

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.8',
40+
'v8_embedder_string': '-node.9',
4141

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

deps/v8/BUILD.gn

+14
Original file line numberDiff line numberDiff line change
@@ -1697,6 +1697,20 @@ config("toolchain") {
16971697
# Fix build with older versions of GCC
16981698
# Ported from v8 bazel: https://crrev.com/c/3368869
16991699
"-Wno-stringop-overflow",
1700+
1701+
# Fix a number of bogus errors with gcc12
1702+
# TODO(miladfarca): re-evaluate for future gcc upgrades
1703+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111499
1704+
"-Wno-stringop-overread",
1705+
1706+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104336
1707+
"-Wno-restrict",
1708+
1709+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
1710+
"-Wno-array-bounds",
1711+
1712+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108517
1713+
"-Wno-nonnull",
17001714
]
17011715
}
17021716

deps/v8/src/d8/d8.cc

+2
Original file line numberDiff line numberDiff line change
@@ -3955,7 +3955,9 @@ V8_NOINLINE void FuzzerMonitor::UseAfterFree() {
39553955
// Use-after-free caught by ASAN.
39563956
std::vector<bool>* storage = new std::vector<bool>(3);
39573957
delete storage;
3958+
#if defined(__clang__)
39583959
USE(storage->at(1));
3960+
#endif
39593961
}
39603962

39613963
V8_NOINLINE void FuzzerMonitor::UseOfUninitializedValue() {

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ WasmCompilationResult WasmCompilationUnit::ExecuteFunctionCompilation(
114114
case ExecutionTier::kNone:
115115
UNREACHABLE();
116116

117-
case ExecutionTier::kLiftoff:
117+
case ExecutionTier::kLiftoff: {
118118
// The --wasm-tier-mask-for-testing flag can force functions to be
119119
// compiled with TurboFan, and the --wasm-debug-mask-for-testing can force
120120
// them to be compiled for debugging, see documentation.
@@ -148,8 +148,8 @@ WasmCompilationResult WasmCompilationUnit::ExecuteFunctionCompilation(
148148
// TODO(wasm): We could actually stop or remove the tiering unit for this
149149
// function to avoid compiling it twice with TurboFan.
150150
V8_FALLTHROUGH;
151-
152-
case ExecutionTier::kTurbofan:
151+
}
152+
case ExecutionTier::kTurbofan: {
153153
compiler::WasmCompilationData data(func_body);
154154
data.func_index = func_index_;
155155
data.wire_bytes_storage = wire_bytes_storage;
@@ -169,6 +169,9 @@ WasmCompilationResult WasmCompilationUnit::ExecuteFunctionCompilation(
169169
detected);
170170
result.for_debugging = for_debugging_;
171171
break;
172+
}
173+
default:
174+
UNREACHABLE();
172175
}
173176

174177
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)