google-protobuf 3.24.0 → 3.24.1

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: ab19f3d9a087b8f4b288ba5a610f1d85d5fc71f1939b34891bea8e8be9736069
4
+ data.tar.gz: 26e9e6b1108d10b1a1098af1820bfd6b4e7a6c892ae9bb946897d78ca765f624
5
5
  SHA512:
6
- metadata.gz: 6750c6f04099f53618bea170202b8b004ec36f81d126ef3d4d2a64d95775146a5f088f8d5c938faf8ebef7a87a04dc1819038faab961c0102248ac8ba4d08e7f
7
- data.tar.gz: 715496a5698143bc68e3f845ad29de4a27f67ba1132092f8eeba73445a9b5e38965e555461e025e6f2a6e7410d6e542c094907a5d1182ca0bafbee17df942cf1
6
+ metadata.gz: ff7e8795da8bc005ccf210891a7ef2e325a5e372ca1e6f66c00611ae2743680c7f276e2352502bdf20c23a74a0e8f6910f35b03165baf43860da797044594826
7
+ data.tar.gz: 8c0d6011a2b6f407e06fec6779f0dbdc5f6400a4afa04edc9cc63023785ab51eac053159c7c5c0297726e6ff83a1a71c0fdf17c3b2b7ef644c5623f72f560778
@@ -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.1
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-18 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.1/ruby
112
112
  post_install_message:
113
113
  rdoc_options: []
114
114
  require_paths: