Skip to content

Commit 61a0d3b

Browse files
richardlautargos
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: #51362 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
1 parent f55380a commit 61a0d3b

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
@@ -1700,6 +1700,20 @@ config("toolchain") {
17001700
# Fix build with older versions of GCC
17011701
# Ported from v8 bazel: https://crrev.com/c/3368869
17021702
"-Wno-stringop-overflow",
1703+
1704+
# Fix a number of bogus errors with gcc12
1705+
# TODO(miladfarca): re-evaluate for future gcc upgrades
1706+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111499
1707+
"-Wno-stringop-overread",
1708+
1709+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104336
1710+
"-Wno-restrict",
1711+
1712+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
1713+
"-Wno-array-bounds",
1714+
1715+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108517
1716+
"-Wno-nonnull",
17031717
]
17041718
}
17051719

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
@@ -112,7 +112,7 @@ WasmCompilationResult WasmCompilationUnit::ExecuteFunctionCompilation(
112112
case ExecutionTier::kNone:
113113
UNREACHABLE();
114114

115-
case ExecutionTier::kLiftoff:
115+
case ExecutionTier::kLiftoff: {
116116
// The --wasm-tier-mask-for-testing flag can force functions to be
117117
// compiled with TurboFan, and the --wasm-debug-mask-for-testing can force
118118
// them to be compiled for debugging, see documentation.
@@ -146,8 +146,8 @@ WasmCompilationResult WasmCompilationUnit::ExecuteFunctionCompilation(
146146
// TODO(wasm): We could actually stop or remove the tiering unit for this
147147
// function to avoid compiling it twice with TurboFan.
148148
V8_FALLTHROUGH;
149-
150-
case ExecutionTier::kTurbofan:
149+
}
150+
case ExecutionTier::kTurbofan: {
151151
compiler::WasmCompilationData data(func_body);
152152
data.func_index = func_index_;
153153
data.wire_bytes_storage = wire_bytes_storage;
@@ -167,6 +167,9 @@ WasmCompilationResult WasmCompilationUnit::ExecuteFunctionCompilation(
167167
detected);
168168
result.for_debugging = for_debugging_;
169169
break;
170+
}
171+
default:
172+
UNREACHABLE();
170173
}
171174

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