google-protobuf 4.34.1 → 4.34.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc77e34a19ccafd79adca65f51812a56fd392c7a1f0673674226459f22cc2d68
4
- data.tar.gz: fbd7c916b6661ea5dbecd3c83ec5a43dc5aaa373946c83899e923912725ec752
3
+ metadata.gz: '07931c80d585248955e51e1b74b44c0f326d544e4228daab959a0baee77a5424'
4
+ data.tar.gz: f89b32b694fda317a8396995e701b26d1567b9a5c8031227c2fd4fe28da86b15
5
5
  SHA512:
6
- metadata.gz: f58fbe5c2f234f87460de4289e74f8864716174e10987af03f00ec31cc8b2a2901796074a913636305465dc46e085d1f15b5681b0975f3530719331e8daab755
7
- data.tar.gz: f308e41bc2dc3884ce535d0b64d13a2cdc9cba48af768cd36af67942e91b981c9fd600f66fd0200f85933ab9e2b44896297255860fd45aa9dedf6aff47df2562
6
+ metadata.gz: 3815581a6170d1edfc1f87353222b5aeb3eb54427df2b768199a0f9893a12268eb0c25373742555c3e4c0c193093a0857fd1b6eb2ab96655e5a3a8eff3976df1
7
+ data.tar.gz: d56cdae4302ec4bfe3046f51225cb5843bb0db2e522ee6e666751f506b18c211807fda1df102003a8bca65af2bd0cf794e9c0b643698facf791abd326644948b
@@ -558,7 +558,15 @@ Error, UINTPTR_MAX is undefined
558
558
  // }
559
559
  // }
560
560
 
561
+ #if defined(__GNUC__) && !defined(__clang__)
562
+ // GCC can't handle mismatched retain attributes in the same section:
563
+ // https://github.com/protocolbuffers/protobuf/issues/26385
564
+ // To work around this, we retain all linker array elements, even though this
565
+ // effectively disables tree-shaking of unused extensions when using GCC.
566
+ #define UPB_LINKARR_ATTR UPB_RETAIN
567
+ #else
561
568
  #define UPB_LINKARR_ATTR
569
+ #endif
562
570
 
563
571
  #define UPB_LINKARR_SENTINEL UPB_RETAIN __attribute__((weak, used))
564
572
 
@@ -10190,7 +10198,12 @@ const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup(
10190
10198
  }
10191
10199
  }
10192
10200
 
10201
+ size_t upb_ExtensionRegistry_Size(const upb_ExtensionRegistry* r) {
10202
+ return upb_strtable_count(&r->exts);
10203
+ }
10204
+
10193
10205
 
10206
+ #include <stddef.h>
10194
10207
  #include <stdint.h>
10195
10208
 
10196
10209
 
@@ -10218,21 +10231,17 @@ static bool _upb_GeneratedRegistry_AddAllLinkedExtensions(
10218
10231
  const UPB_PRIVATE(upb_GeneratedExtensionListEntry)* entry =
10219
10232
  UPB_PRIVATE(upb_generated_extension_list);
10220
10233
  while (entry != NULL) {
10221
- // Comparing pointers to different objects is undefined behavior, so we
10222
- // convert them to uintptr_t and compare their values.
10223
- uintptr_t begin = (uintptr_t)entry->start;
10224
- uintptr_t end = (uintptr_t)entry->stop;
10225
- uintptr_t current = begin;
10226
- while (current < end) {
10227
- const upb_MiniTableExtension* ext =
10228
- (const upb_MiniTableExtension*)current;
10234
+ const upb_MiniTableExtension** current = entry->start;
10235
+ for (current = entry->start; current != entry->stop; ++current) {
10236
+ const upb_MiniTableExtension* ext = *current;
10229
10237
  // Sentinels and padding introduced by the linker can result in zeroed
10230
10238
  // entries, so simply skip them.
10231
- if (upb_MiniTableExtension_Number(ext) == 0) {
10239
+ if (*current == NULL) {
10232
10240
  // MSVC introduces padding that might not be sized exactly the same as
10233
- // upb_MiniTableExtension, so we can't iterate by sizeof. This is a
10234
- // valid thing for any linker to do, so it's safer to just always do it.
10235
- current += UPB_ALIGN_OF(upb_MiniTableExtension);
10241
+ // the linker array element, but it should be properly aligned, so just
10242
+ // skipping empty elements should be safe. (If the size and align of
10243
+ // the array elements was different, we'd have to do something more
10244
+ // complicated).
10236
10245
  continue;
10237
10246
  }
10238
10247
 
@@ -10240,7 +10249,6 @@ static bool _upb_GeneratedRegistry_AddAllLinkedExtensions(
10240
10249
  kUpb_ExtensionRegistryStatus_Ok) {
10241
10250
  return false;
10242
10251
  }
10243
- current += sizeof(upb_MiniTableExtension);
10244
10252
  }
10245
10253
  entry = entry->next;
10246
10254
  }
@@ -557,7 +557,15 @@ Error, UINTPTR_MAX is undefined
557
557
  // }
558
558
  // }
559
559
 
560
+ #if defined(__GNUC__) && !defined(__clang__)
561
+ // GCC can't handle mismatched retain attributes in the same section:
562
+ // https://github.com/protocolbuffers/protobuf/issues/26385
563
+ // To work around this, we retain all linker array elements, even though this
564
+ // effectively disables tree-shaking of unused extensions when using GCC.
565
+ #define UPB_LINKARR_ATTR UPB_RETAIN
566
+ #else
560
567
  #define UPB_LINKARR_ATTR
568
+ #endif
561
569
 
562
570
  #define UPB_LINKARR_SENTINEL UPB_RETAIN __attribute__((weak, used))
563
571
 
@@ -5790,6 +5798,9 @@ upb_ExtensionRegistryStatus upb_ExtensionRegistry_AddArray(
5790
5798
  UPB_API const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup(
5791
5799
  const upb_ExtensionRegistry* r, const upb_MiniTable* t, uint32_t num);
5792
5800
 
5801
+ // Returns the number of extensions in the registry. For testing/debugging only.
5802
+ UPB_API size_t upb_ExtensionRegistry_Size(const upb_ExtensionRegistry* r);
5803
+
5793
5804
  #ifdef __cplusplus
5794
5805
  } /* extern "C" */
5795
5806
  #endif
@@ -5900,8 +5911,8 @@ extern "C" {
5900
5911
  #endif
5901
5912
 
5902
5913
  typedef struct UPB_PRIVATE(upb_GeneratedExtensionListEntry) {
5903
- const struct upb_MiniTableExtension* start;
5904
- const struct upb_MiniTableExtension* stop;
5914
+ const struct upb_MiniTableExtension** start;
5915
+ const struct upb_MiniTableExtension** stop;
5905
5916
  const struct UPB_PRIVATE(upb_GeneratedExtensionListEntry) * next;
5906
5917
  } UPB_PRIVATE(upb_GeneratedExtensionListEntry);
5907
5918
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-protobuf
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.34.1
4
+ version: 4.34.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Protobuf Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-19 00:00:00.000000000 Z
11
+ date: 2026-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal
@@ -183,7 +183,7 @@ homepage: https://developers.google.com/protocol-buffers
183
183
  licenses:
184
184
  - BSD-3-Clause
185
185
  metadata:
186
- source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v4.34.1/ruby
186
+ source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v4.34.2/ruby
187
187
  post_install_message:
188
188
  rdoc_options: []
189
189
  require_paths:
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
199
  - !ruby/object:Gem::Version
200
200
  version: '0'
201
201
  requirements: []
202
- rubygems_version: 3.5.16
202
+ rubygems_version: 3.3.27
203
203
  signing_key:
204
204
  specification_version: 4
205
205
  summary: Protocol Buffers