google-protobuf 3.24.0 → 3.24.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7cee93054ce792ab5f48f53a8b4f11e8463929cdba93302fe84d9d6d576a8178
4
- data.tar.gz: 56bf5d577f780ddd4d57382beb29e2939482c89b81f45aeaa282e5a83c270645
3
+ metadata.gz: cf48c0d6a0d1ce35d86442804d199c1e2f5a955842d5e7826537c102be223692
4
+ data.tar.gz: 78b7667015c96b18f9ee8e5e1e21a6f65fdeefa64f7dd93f24f851efdcdbfccd
5
5
  SHA512:
6
- metadata.gz: 6750c6f04099f53618bea170202b8b004ec36f81d126ef3d4d2a64d95775146a5f088f8d5c938faf8ebef7a87a04dc1819038faab961c0102248ac8ba4d08e7f
7
- data.tar.gz: 715496a5698143bc68e3f845ad29de4a27f67ba1132092f8eeba73445a9b5e38965e555461e025e6f2a6e7410d6e542c094907a5d1182ca0bafbee17df942cf1
6
+ metadata.gz: 68e86b764f88f359f5fdb871f1a0412e14a2fd1527038f1adde2a0364afed3c52fa0174d94f6c956de396afab37907002dbd889252c320d65ded76255c2121c9
7
+ data.tar.gz: 20f14f7785b4285efb5fac6565b74d33e03ffd5e9db9f7c79a7c674b31ea46c77c1f7089e9b1efbe41dd34b7dfbb5a55b51f3b04d3bc858ebbf55ce227cd9edf
@@ -276,17 +276,25 @@ static void ObjectCache_Init(VALUE protobuf) {
276
276
  rb_const_set(protobuf, rb_intern("SIZEOF_VALUE"), INT2NUM(SIZEOF_VALUE));
277
277
  }
278
278
 
279
- VALUE ObjectCache_TryAdd(const void *key, VALUE val) {
279
+ static VALUE ObjectCache_GetKey(const void *key) {
280
280
  VALUE key_val = (VALUE)key;
281
281
  PBRUBY_ASSERT((key_val & 3) == 0);
282
- return rb_funcall(weak_obj_cache, item_try_add, 2, LL2NUM(key_val), val);
282
+ // Ensure the key can be stored as a Fixnum since 1 bit is needed for
283
+ // FIXNUM_FLAG and 1 bit is needed for the sign bit.
284
+ VALUE new_key = LL2NUM(key_val >> 2);
285
+ PBRUBY_ASSERT(FIXNUM_P(new_key));
286
+ return new_key;
287
+ }
288
+
289
+ VALUE ObjectCache_TryAdd(const void *key, VALUE val) {
290
+ VALUE key_val = ObjectCache_GetKey(key);
291
+ return rb_funcall(weak_obj_cache, item_try_add, 2, key_val, val);
283
292
  }
284
293
 
285
294
  // Returns the cached object for this key, if any. Otherwise returns Qnil.
286
295
  VALUE ObjectCache_Get(const void *key) {
287
- VALUE key_val = (VALUE)key;
288
- PBRUBY_ASSERT((key_val & 3) == 0);
289
- return rb_funcall(weak_obj_cache, item_get, 1, LL2NUM(key_val));
296
+ VALUE key_val = ObjectCache_GetKey(key);
297
+ return rb_funcall(weak_obj_cache, item_get, 1, key_val);
290
298
  }
291
299
 
292
300
  /*
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: 3.24.0
4
+ version: 3.24.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: 2023-08-08 00:00:00.000000000 Z
11
+ date: 2023-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler-dock
@@ -108,7 +108,7 @@ homepage: https://developers.google.com/protocol-buffers
108
108
  licenses:
109
109
  - BSD-3-Clause
110
110
  metadata:
111
- source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v3.24.0/ruby
111
+ source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v3.24.2/ruby
112
112
  post_install_message:
113
113
  rdoc_options: []
114
114
  require_paths: