google-protobuf 3.24.0-x86_64-linux → 3.24.2-x86_64-linux

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: aa7b1a174a98d85be6f2eb7cd076965447c675354b044bf819fb3955df502a4d
4
- data.tar.gz: 4f8f8124e286985109fa29db9fcb34af43f1462a5a966356774dabea61b2cf7e
3
+ metadata.gz: caa49296af5992c2e36ad5a12cd39037ad3619a66a39c56e35b154943437dad8
4
+ data.tar.gz: 759564bbbb3d5e5752f3b7cbdf176e5ee9abdf322de3c80c03c98fa8f12fd207
5
5
  SHA512:
6
- metadata.gz: 674353859932a1e87c2a8d392b1c4b714271d3f500cac39ad65f2ef0f0dd3305dcbe758a5e558077faaaa81d248e32c13a1fa43bbd803c968902f0c26412b3e4
7
- data.tar.gz: 70cae2c89eaf4003caaff6c0786243891ce6265c0fd972d1634692c8ae78c40ac639fd954153283b9df0a9a3f948107afacf6a6332c0ec574a6a61257459a6ea
6
+ metadata.gz: 3bcfe4dd81f55504f819ed4383a8247e20ec41197bd198f9fdff7f7456e8c93691064bfe77917625bb509e78eb4ff4775d9406be56b48aa24ef8ae5b464e2998
7
+ data.tar.gz: c3350e5db93b1f7b2c3c236316f4053c214693df8ffb09bd918e6a7121be64e50fab43ab4e27871503d79454d2f72efcad4f65e7cea2043912db3292feba1ba3
@@ -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
  /*
Binary file
Binary file
Binary file
Binary file
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: x86_64-linux
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
@@ -111,7 +111,7 @@ homepage: https://developers.google.com/protocol-buffers
111
111
  licenses:
112
112
  - BSD-3-Clause
113
113
  metadata:
114
- source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v3.24.0/ruby
114
+ source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v3.24.2/ruby
115
115
  post_install_message:
116
116
  rdoc_options: []
117
117
  require_paths: