mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-20 00:16:38 +02:00
28 lines
No EOL
1.3 KiB
Diff
28 lines
No EOL
1.3 KiB
Diff
diff --git a/src/google/protobuf/any_test.cc b/src/google/protobuf/any_test.cc
|
|
index f8f4eb98b..30c9299b2 100644
|
|
--- a/src/google/protobuf/any_test.cc
|
|
+++ b/src/google/protobuf/any_test.cc
|
|
@@ -42,6 +42,9 @@ TEST(AnyTest, TestPackAndUnpack) {
|
|
TEST(AnyTest, TestPackFromSerializationExceedsSizeLimit) {
|
|
#if defined(_MSC_VER) && defined(_M_IX86)
|
|
GTEST_SKIP() << "This toolchain can't allocate that much memory.";
|
|
+#elif defined(__i386__) || \
|
|
+ (defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 4)
|
|
+ GTEST_SKIP() << "This architecture can't allocate that much memory.";
|
|
#endif
|
|
protobuf_unittest::TestAny submessage;
|
|
submessage.mutable_text()->resize(INT_MAX, 'a');
|
|
diff --git a/src/google/protobuf/generated_enum_util.cc b/src/google/protobuf/generated_enum_util.cc
|
|
index 372899e16..89ac60620 100644
|
|
--- a/src/google/protobuf/generated_enum_util.cc
|
|
+++ b/src/google/protobuf/generated_enum_util.cc
|
|
@@ -137,7 +137,8 @@ std::vector<uint32_t> GenerateEnumData(absl::Span<const int32_t> values) {
|
|
int64_t a = static_cast<int64_t>(v) - *start_sequence - sequence_length;
|
|
ABSL_DCHECK(a >= 0);
|
|
ABSL_DCHECK_EQ(a, static_cast<uint32_t>(a));
|
|
- return a;
|
|
+ return a >= 0 ? static_cast<uint32_t>(a)
|
|
+ : 0; // Ensure non-negative value
|
|
};
|
|
const uint32_t adjusted = adjust(v);
|
|
|