oj 3.13.18 → 3.13.19

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: e7ca20e7921e7b9a3e2838ecbe3505ecb736bce338113a3db3187f411d1762ca
4
- data.tar.gz: 6c09a24ddb7017caa2a2850076a6b0fcbccc6ed27cd6e28e28de7fadacbaa7fe
3
+ metadata.gz: bfbe0dd2157d1aba97ad11d82eee1870fbb64f4f197ae75b17a2e781c64144f7
4
+ data.tar.gz: 907ff02298adc4555834ca1c1c6078a3586abfde85f790b4dcba284c5be60248
5
5
  SHA512:
6
- metadata.gz: 9e1bb01e19979391421d87b0598ff543ce3035a86fcbb06a68b63d4b56f4194739213d506fdd0492f5cf4a2aabd037872935fcb16f5d083fd6e532c6aa869b8d
7
- data.tar.gz: 29db51398d6008cbcb827af666da0b41b750f6aea3e561fe37b2354f48b88d2bf393dcbfed931679072042bd19cf179ec0ae674027527b627391c2c4792f3c63
6
+ metadata.gz: c56828991af620bb1436db19b5660ec588fce4858b455bd2b6c7f11f2bccaf3a7afca8fe98b62ad868a1a18ab584d38220e1b5c4c1243d3a8c1201c3b0c51a54
7
+ data.tar.gz: f687f4bd9a0a64ecd75cee755722cc2f4f80fc356fe884fd34bf5cf68066d2e648050de7a49c93c121740e790afbcc168b1a8efc5f8280f64ca9bf3d23bc736b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.13.19 - 2022-07-29
4
+
5
+ - TruffleRuby issues resolved.
6
+
3
7
  ## 3.13.18 - 2022-07-25
4
8
 
5
9
  - Fixed SSE detection at run time.
data/ext/oj/parse.c CHANGED
@@ -211,6 +211,10 @@ static inline const char *scan_string_noSIMD(const char *str, const char *end) {
211
211
  #undef USE_SSE_DETECT
212
212
  #endif
213
213
 
214
+ #if defined(TRUFFLERUBY)
215
+ #undef USE_SSE_DETECT
216
+ #endif
217
+
214
218
  #ifdef USE_SSE_DETECT
215
219
  #include <nmmintrin.h>
216
220
 
data/ext/oj/parse.h CHANGED
@@ -97,7 +97,7 @@ static inline void parse_info_init(ParseInfo pi) {
97
97
  memset(pi, 0, sizeof(struct _parseInfo));
98
98
  }
99
99
 
100
- extern void oj_scanner_init();
100
+ extern void oj_scanner_init(void);
101
101
 
102
102
  static inline bool empty_ok(Options options) {
103
103
  switch (options->mode) {
data/ext/oj/saj2.c CHANGED
@@ -289,7 +289,7 @@ static void add_float_key_loc(ojParser p) {
289
289
  }
290
290
 
291
291
  static void add_big(ojParser p) {
292
- rb_funcall((VALUE)p->ctx,
292
+ rb_funcall(((Delegate)p->ctx)->handler,
293
293
  oj_add_value_id,
294
294
  2,
295
295
  rb_funcall(rb_cObject, oj_bigdecimal_id, 1, rb_str_new(buf_str(&p->buf), buf_len(&p->buf))),
@@ -297,7 +297,7 @@ static void add_big(ojParser p) {
297
297
  }
298
298
 
299
299
  static void add_big_loc(ojParser p) {
300
- rb_funcall((VALUE)p->ctx,
300
+ rb_funcall(((Delegate)p->ctx)->handler,
301
301
  oj_add_value_id,
302
302
  4,
303
303
  rb_funcall(rb_cObject, oj_bigdecimal_id, 1, rb_str_new(buf_str(&p->buf), buf_len(&p->buf))),
@@ -307,7 +307,7 @@ static void add_big_loc(ojParser p) {
307
307
  }
308
308
 
309
309
  static void add_big_key(ojParser p) {
310
- rb_funcall((VALUE)p->ctx,
310
+ rb_funcall(((Delegate)p->ctx)->handler,
311
311
  oj_add_value_id,
312
312
  2,
313
313
  rb_funcall(rb_cObject, oj_bigdecimal_id, 1, rb_str_new(buf_str(&p->buf), buf_len(&p->buf))),
data/lib/oj/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Oj
3
3
  # Current version of the module.
4
- VERSION = '3.13.18'
4
+ VERSION = '3.13.19'
5
5
  end
data/test/helper.rb CHANGED
@@ -19,10 +19,16 @@ require 'pp'
19
19
  require 'oj'
20
20
 
21
21
 
22
- if defined?(GC.verify_compaction_references) == 'method'
22
+ def verify_gc_compaction
23
23
  # This method was added in Ruby 3.0.0. Calling it this way asks the GC to
24
24
  # move objects around, helping to find object movement bugs.
25
- GC.verify_compaction_references(double_heap: true, toward: :empty)
25
+ if defined?(GC.verify_compaction_references) == 'method' && !(RbConfig::CONFIG['host_os'] =~ /(mingw|mswin)/)
26
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.2.0")
27
+ GC.verify_compaction_references(expand_heap: true, toward: :empty)
28
+ else
29
+ GC.verify_compaction_references(double_heap: true, toward: :empty)
30
+ end
31
+ end
26
32
  end
27
33
 
28
34
 
@@ -15,10 +15,14 @@ else
15
15
  require 'oj'
16
16
  Oj.mimic_JSON
17
17
 
18
+ # This method was added in Ruby 3.0.0. Calling it this way asks the GC to
19
+ # move objects around, helping to find object movement bugs.
18
20
  if defined?(GC.verify_compaction_references) == 'method'
19
- # This method was added in Ruby 3.0.0. Calling it this way asks the GC to
20
- # move objects around, helping to find object movement bugs.
21
- GC.verify_compaction_references(double_heap: true, toward: :empty)
21
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.2.0")
22
+ GC.verify_compaction_references(expand_heap: true, toward: :empty)
23
+ else
24
+ GC.verify_compaction_references(double_heap: true, toward: :empty)
25
+ end
22
26
  end
23
27
  end
24
28
 
data/test/test_object.rb CHANGED
@@ -224,7 +224,7 @@ class ObjectJuice < Minitest::Test
224
224
  #=begin
225
225
  if '3.1.0' <= RUBY_VERSION && !(RbConfig::CONFIG['host_os'] =~ /(mingw|mswin)/)
226
226
  #Oj::debug_odd("teardown before GC.verify_compaction_references")
227
- GC.verify_compaction_references(double_heap: true, toward: :empty)
227
+ verify_gc_compaction
228
228
  #Oj::debug_odd("teardown after GC.verify_compaction_references")
229
229
  end
230
230
  #=end
@@ -149,6 +149,17 @@ class SajTest < Minitest::Test
149
149
  assert_equal((12345.6789e7 * 10000).to_i, (handler.calls[0][1] * 10000).to_i)
150
150
  end
151
151
 
152
+ def test_bignum
153
+ handler = AllSaj.new()
154
+ json = %{-11.899999999999999}
155
+ p = Oj::Parser.new(:saj)
156
+ p.handler = handler
157
+ p.parse(json)
158
+ assert_equal(1, handler.calls.size)
159
+ assert_equal(:add_value, handler.calls[0][0])
160
+ assert_equal(-118999, (handler.calls[0][1] * 10000).to_i)
161
+ end
162
+
152
163
  def test_array_empty
153
164
  handler = AllSaj.new()
154
165
  json = %{[]}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oj
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.13.18
4
+ version: 3.13.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ohler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-25 00:00:00.000000000 Z
11
+ date: 2022-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler