Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: V8: backports for gcc 12 #52183

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.gypi
Expand Up @@ -37,7 +37,7 @@

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

##### V8 defaults for Node.js #####

Expand Down
18 changes: 18 additions & 0 deletions deps/v8/BUILD.gn
Expand Up @@ -1664,6 +1664,24 @@ config("toolchain") {
# of `this` in capture-by-value lambdas and preventing a build roll which
# enables C++20 (see https://crbug.com/1374227).
"-Wno-deprecated",

# Fix build with older versions of GCC
# Ported from v8 bazel: https://crrev.com/c/3368869
"-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",
]
}

Expand Down
2 changes: 2 additions & 0 deletions deps/v8/src/d8/d8.cc
Expand Up @@ -4022,7 +4022,9 @@ V8_NOINLINE void FuzzerMonitor::UseAfterFree() {
// Use-after-free caught by ASAN.
std::vector<bool>* storage = new std::vector<bool>(3);
delete storage;
#if defined(__clang__)
USE(storage->at(1));
#endif
}

V8_NOINLINE void FuzzerMonitor::UseOfUninitializedValue() {
Expand Down
9 changes: 6 additions & 3 deletions deps/v8/src/wasm/function-compiler.cc
Expand Up @@ -110,7 +110,7 @@ WasmCompilationResult WasmCompilationUnit::ExecuteFunctionCompilation(
case ExecutionTier::kNone:
UNREACHABLE();

case ExecutionTier::kLiftoff:
case ExecutionTier::kLiftoff: {
// The --wasm-tier-mask-for-testing flag can force functions to be
// compiled with TurboFan, and the --wasm-debug-mask-for-testing can force
// them to be compiled for debugging, see documentation.
Expand Down Expand Up @@ -144,8 +144,8 @@ WasmCompilationResult WasmCompilationUnit::ExecuteFunctionCompilation(
// TODO(wasm): We could actually stop or remove the tiering unit for this
// function to avoid compiling it twice with TurboFan.
V8_FALLTHROUGH;

case ExecutionTier::kTurbofan:
}
case ExecutionTier::kTurbofan: {
compiler::WasmCompilationData data(func_body);
data.func_index = func_index_;
data.wire_bytes_storage = wire_bytes_storage;
Expand All @@ -165,6 +165,9 @@ WasmCompilationResult WasmCompilationUnit::ExecuteFunctionCompilation(
detected);
result.for_debugging = for_debugging_;
break;
}
default:
UNREACHABLE();
}

DCHECK(result.succeeded());
Expand Down
20 changes: 11 additions & 9 deletions deps/v8/third_party/inspector_protocol/crdtp/dispatch_test.cc
Expand Up @@ -169,10 +169,11 @@ TEST(DispatchableTest, MessageWithUnknownProperty) {
}

TEST(DispatchableTest, DuplicateMapKey) {
for (const std::string& json :
{"{\"id\":42,\"id\":42}", "{\"params\":null,\"params\":null}",
"{\"method\":\"foo\",\"method\":\"foo\"}",
"{\"sessionId\":\"42\",\"sessionId\":\"42\"}"}) {
const std::array<std::string, 4> jsons = {
{"{\"id\":42,\"id\":42}", "{\"params\":null,\"params\":null}",
"{\"method\":\"foo\",\"method\":\"foo\"}",
"{\"sessionId\":\"42\",\"sessionId\":\"42\"}"}};
for (const std::string& json : jsons) {
SCOPED_TRACE("json = " + json);
std::vector<uint8_t> cbor;
ASSERT_TRUE(json::ConvertJSONToCBOR(SpanFrom(json), &cbor).ok());
Expand All @@ -185,11 +186,12 @@ TEST(DispatchableTest, DuplicateMapKey) {
}

TEST(DispatchableTest, ValidMessageParsesOK_NoParams) {
for (const std::string& json :
{"{\"id\":42,\"method\":\"Foo.executeBar\",\"sessionId\":"
"\"f421ssvaz4\"}",
"{\"id\":42,\"method\":\"Foo.executeBar\",\"sessionId\":\"f421ssvaz4\","
"\"params\":null}"}) {
const std::array<std::string, 2> jsons = {
{"{\"id\":42,\"method\":\"Foo.executeBar\",\"sessionId\":"
"\"f421ssvaz4\"}",
"{\"id\":42,\"method\":\"Foo.executeBar\",\"sessionId\":\"f421ssvaz4\","
"\"params\":null}"}};
for (const std::string& json : jsons) {
SCOPED_TRACE("json = " + json);
std::vector<uint8_t> cbor;
ASSERT_TRUE(json::ConvertJSONToCBOR(SpanFrom(json), &cbor).ok());
Expand Down
19 changes: 10 additions & 9 deletions deps/v8/third_party/inspector_protocol/crdtp/json_test.cc
Expand Up @@ -704,15 +704,16 @@ using ContainerTestTypes = ::testing::Types<std::vector<uint8_t>, std::string>;
TYPED_TEST_SUITE(ConvertJSONToCBORTest, ContainerTestTypes);

TYPED_TEST(ConvertJSONToCBORTest, RoundTripValidJson) {
for (const std::string& json_in : {
"{\"msg\":\"Hello, world.\",\"lst\":[1,2,3]}",
"3.1415",
"false",
"true",
"\"Hello, world.\"",
"[1,2,3]",
"[]",
}) {
const std::array<std::string, 7> jsons = {{
"{\"msg\":\"Hello, world.\",\"lst\":[1,2,3]}",
"3.1415",
"false",
"true",
"\"Hello, world.\"",
"[1,2,3]",
"[]",
}};
for (const std::string& json_in : jsons) {
SCOPED_TRACE(json_in);
TypeParam json(json_in.begin(), json_in.end());
std::vector<uint8_t> cbor;
Expand Down