mirror of https://github.com/nodejs/node.git
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:pull/52505/headc4be0a97f9
PR-URL: https://github.com/nodejs/node/pull/52183 Refs:f8d5e576b8
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: https://github.com/nodejs/node/pull/52293 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
parent
681aaf85c7
commit
021b0b7dee
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
# Reset this number to 0 on major V8 upgrades.
|
# Reset this number to 0 on major V8 upgrades.
|
||||||
# Increment by one for each non-official patch applied to deps/v8.
|
# Increment by one for each non-official patch applied to deps/v8.
|
||||||
'v8_embedder_string': '-node.8',
|
'v8_embedder_string': '-node.9',
|
||||||
|
|
||||||
##### V8 defaults for Node.js #####
|
##### V8 defaults for Node.js #####
|
||||||
|
|
||||||
|
|
|
@ -1697,6 +1697,20 @@ config("toolchain") {
|
||||||
# Fix build with older versions of GCC
|
# Fix build with older versions of GCC
|
||||||
# Ported from v8 bazel: https://crrev.com/c/3368869
|
# Ported from v8 bazel: https://crrev.com/c/3368869
|
||||||
"-Wno-stringop-overflow",
|
"-Wno-stringop-overflow",
|
||||||
|
|
||||||
|
# Fix a number of bogus errors with gcc12
|
||||||
|
# TODO(miladfarca): re-evaluate for future gcc upgrades
|
||||||
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111499
|
||||||
|
"-Wno-stringop-overread",
|
||||||
|
|
||||||
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104336
|
||||||
|
"-Wno-restrict",
|
||||||
|
|
||||||
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
|
||||||
|
"-Wno-array-bounds",
|
||||||
|
|
||||||
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108517
|
||||||
|
"-Wno-nonnull",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3955,7 +3955,9 @@ V8_NOINLINE void FuzzerMonitor::UseAfterFree() {
|
||||||
// Use-after-free caught by ASAN.
|
// Use-after-free caught by ASAN.
|
||||||
std::vector<bool>* storage = new std::vector<bool>(3);
|
std::vector<bool>* storage = new std::vector<bool>(3);
|
||||||
delete storage;
|
delete storage;
|
||||||
|
#if defined(__clang__)
|
||||||
USE(storage->at(1));
|
USE(storage->at(1));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
V8_NOINLINE void FuzzerMonitor::UseOfUninitializedValue() {
|
V8_NOINLINE void FuzzerMonitor::UseOfUninitializedValue() {
|
||||||
|
|
|
@ -114,7 +114,7 @@ WasmCompilationResult WasmCompilationUnit::ExecuteFunctionCompilation(
|
||||||
case ExecutionTier::kNone:
|
case ExecutionTier::kNone:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
|
||||||
case ExecutionTier::kLiftoff:
|
case ExecutionTier::kLiftoff: {
|
||||||
// The --wasm-tier-mask-for-testing flag can force functions to be
|
// The --wasm-tier-mask-for-testing flag can force functions to be
|
||||||
// compiled with TurboFan, and the --wasm-debug-mask-for-testing can force
|
// compiled with TurboFan, and the --wasm-debug-mask-for-testing can force
|
||||||
// them to be compiled for debugging, see documentation.
|
// them to be compiled for debugging, see documentation.
|
||||||
|
@ -148,8 +148,8 @@ WasmCompilationResult WasmCompilationUnit::ExecuteFunctionCompilation(
|
||||||
// TODO(wasm): We could actually stop or remove the tiering unit for this
|
// TODO(wasm): We could actually stop or remove the tiering unit for this
|
||||||
// function to avoid compiling it twice with TurboFan.
|
// function to avoid compiling it twice with TurboFan.
|
||||||
V8_FALLTHROUGH;
|
V8_FALLTHROUGH;
|
||||||
|
}
|
||||||
case ExecutionTier::kTurbofan:
|
case ExecutionTier::kTurbofan: {
|
||||||
compiler::WasmCompilationData data(func_body);
|
compiler::WasmCompilationData data(func_body);
|
||||||
data.func_index = func_index_;
|
data.func_index = func_index_;
|
||||||
data.wire_bytes_storage = wire_bytes_storage;
|
data.wire_bytes_storage = wire_bytes_storage;
|
||||||
|
@ -169,6 +169,9 @@ WasmCompilationResult WasmCompilationUnit::ExecuteFunctionCompilation(
|
||||||
detected);
|
detected);
|
||||||
result.for_debugging = for_debugging_;
|
result.for_debugging = for_debugging_;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
DCHECK(result.succeeded());
|
DCHECK(result.succeeded());
|
||||||
|
|
|
@ -169,10 +169,11 @@ TEST(DispatchableTest, MessageWithUnknownProperty) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(DispatchableTest, DuplicateMapKey) {
|
TEST(DispatchableTest, DuplicateMapKey) {
|
||||||
for (const std::string& json :
|
const std::array<std::string, 4> jsons = {
|
||||||
{"{\"id\":42,\"id\":42}", "{\"params\":null,\"params\":null}",
|
{"{\"id\":42,\"id\":42}", "{\"params\":null,\"params\":null}",
|
||||||
"{\"method\":\"foo\",\"method\":\"foo\"}",
|
"{\"method\":\"foo\",\"method\":\"foo\"}",
|
||||||
"{\"sessionId\":\"42\",\"sessionId\":\"42\"}"}) {
|
"{\"sessionId\":\"42\",\"sessionId\":\"42\"}"}};
|
||||||
|
for (const std::string& json : jsons) {
|
||||||
SCOPED_TRACE("json = " + json);
|
SCOPED_TRACE("json = " + json);
|
||||||
std::vector<uint8_t> cbor;
|
std::vector<uint8_t> cbor;
|
||||||
ASSERT_TRUE(json::ConvertJSONToCBOR(SpanFrom(json), &cbor).ok());
|
ASSERT_TRUE(json::ConvertJSONToCBOR(SpanFrom(json), &cbor).ok());
|
||||||
|
@ -185,11 +186,12 @@ TEST(DispatchableTest, DuplicateMapKey) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(DispatchableTest, ValidMessageParsesOK_NoParams) {
|
TEST(DispatchableTest, ValidMessageParsesOK_NoParams) {
|
||||||
for (const std::string& json :
|
const std::array<std::string, 2> jsons = {
|
||||||
{"{\"id\":42,\"method\":\"Foo.executeBar\",\"sessionId\":"
|
{"{\"id\":42,\"method\":\"Foo.executeBar\",\"sessionId\":"
|
||||||
"\"f421ssvaz4\"}",
|
"\"f421ssvaz4\"}",
|
||||||
"{\"id\":42,\"method\":\"Foo.executeBar\",\"sessionId\":\"f421ssvaz4\","
|
"{\"id\":42,\"method\":\"Foo.executeBar\",\"sessionId\":\"f421ssvaz4\","
|
||||||
"\"params\":null}"}) {
|
"\"params\":null}"}};
|
||||||
|
for (const std::string& json : jsons) {
|
||||||
SCOPED_TRACE("json = " + json);
|
SCOPED_TRACE("json = " + json);
|
||||||
std::vector<uint8_t> cbor;
|
std::vector<uint8_t> cbor;
|
||||||
ASSERT_TRUE(json::ConvertJSONToCBOR(SpanFrom(json), &cbor).ok());
|
ASSERT_TRUE(json::ConvertJSONToCBOR(SpanFrom(json), &cbor).ok());
|
||||||
|
|
|
@ -704,15 +704,16 @@ using ContainerTestTypes = ::testing::Types<std::vector<uint8_t>, std::string>;
|
||||||
TYPED_TEST_SUITE(ConvertJSONToCBORTest, ContainerTestTypes);
|
TYPED_TEST_SUITE(ConvertJSONToCBORTest, ContainerTestTypes);
|
||||||
|
|
||||||
TYPED_TEST(ConvertJSONToCBORTest, RoundTripValidJson) {
|
TYPED_TEST(ConvertJSONToCBORTest, RoundTripValidJson) {
|
||||||
for (const std::string& json_in : {
|
const std::array<std::string, 7> jsons = {{
|
||||||
"{\"msg\":\"Hello, world.\",\"lst\":[1,2,3]}",
|
"{\"msg\":\"Hello, world.\",\"lst\":[1,2,3]}",
|
||||||
"3.1415",
|
"3.1415",
|
||||||
"false",
|
"false",
|
||||||
"true",
|
"true",
|
||||||
"\"Hello, world.\"",
|
"\"Hello, world.\"",
|
||||||
"[1,2,3]",
|
"[1,2,3]",
|
||||||
"[]",
|
"[]",
|
||||||
}) {
|
}};
|
||||||
|
for (const std::string& json_in : jsons) {
|
||||||
SCOPED_TRACE(json_in);
|
SCOPED_TRACE(json_in);
|
||||||
TypeParam json(json_in.begin(), json_in.end());
|
TypeParam json(json_in.begin(), json_in.end());
|
||||||
std::vector<uint8_t> cbor;
|
std::vector<uint8_t> cbor;
|
||||||
|
|
Loading…
Reference in New Issue