diff --git a/test/json/json_generator_test.rb b/test/json/json_generator_test.rb index 00960dffee8d7f..0eb85a82653e7c 100755 --- a/test/json/json_generator_test.rb +++ b/test/json/json_generator_test.rb @@ -504,10 +504,14 @@ def to_s end alias_method :to_s, :to_s end - case RUBY_PLATFORM - when "java" + case RUBY_ENGINE + when "jruby" assert_equal bignum_to_s, JSON.generate(bignum) - else + when "truffleruby" + assert_raise(NoMethodError) do + JSON.generate(bignum) + end + when "ruby" assert_raise(TypeError) do JSON.generate(bignum) end diff --git a/vm_dump.c b/vm_dump.c index e2b4804ab0d583..4864ccf58bdb30 100644 --- a/vm_dump.c +++ b/vm_dump.c @@ -1435,8 +1435,11 @@ rb_vm_bugreport(const void *ctx, FILE *errout) kprintf("-- Threading information " "---------------------------------------------------\n"); kprintf("Total ractor count: %u\n", vm->ractor.cnt); - kprintf("Ruby thread count for this ractor: %u\n", rb_ec_ractor_ptr(ec)->threads.cnt); - if (ec->thread_ptr->scheduler != Qnil) { + const rb_ractor_t *cr = rb_ec_ractor_ptr(ec); + if (cr) { + kprintf("Ruby thread count for this ractor: %u\n", cr->threads.cnt); + } + if (ec->thread_ptr && ec->thread_ptr->scheduler != Qnil) { kprintf("Note that the Fiber scheduler is enabled\n"); } kputs("\n");