[前][次][番号順一覧][スレッド一覧]

ruby-changes:60551

From: Benoit <ko1@a...>
Date: Sat, 28 Mar 2020 20:36:03 +0900 (JST)
Subject: [ruby-changes:60551] 282c9d1bbe (master): Remove spec which is an incorrect usage of rb_rescue2()

https://git.ruby-lang.org/ruby.git/commit/?id=282c9d1bbe

From 282c9d1bbe9057c6dfd6694a82c9264354f3f23b Mon Sep 17 00:00:00 2001
From: Benoit Daloze <eregontp@g...>
Date: Sat, 28 Mar 2020 12:34:45 +0100
Subject: Remove spec which is an incorrect usage of rb_rescue2()

* It segfaults on MRI.

diff --git a/spec/ruby/optional/capi/ext/kernel_spec.c b/spec/ruby/optional/capi/ext/kernel_spec.c
index 351a68e..6d074de 100644
--- a/spec/ruby/optional/capi/ext/kernel_spec.c
+++ b/spec/ruby/optional/capi/ext/kernel_spec.c
@@ -180,21 +180,6 @@ VALUE kernel_spec_rb_rescue2(int argc, VALUE *args, VALUE self) { https://github.com/ruby/ruby/blob/trunk/spec/ruby/optional/capi/ext/kernel_spec.c#L180
       kernel_spec_call_proc_raise, raise_array, args[4], args[5], (VALUE)0);
 }
 
-VALUE kernel_spec_rb_rescue2_wrong_terminator_arg_type(int argc, VALUE *args, VALUE self) {
-  VALUE main_array, raise_array;
-
-  main_array = rb_ary_new();
-  rb_ary_push(main_array, args[0]);
-  rb_ary_push(main_array, args[1]);
-
-  raise_array = rb_ary_new();
-  rb_ary_push(raise_array, args[2]);
-  rb_ary_push(raise_array, args[3]);
-
-  return rb_rescue2(kernel_spec_call_proc, main_array,
-      kernel_spec_call_proc_raise, raise_array, args[4], args[5], 0);
-}
-
 static VALUE kernel_spec_rb_protect_yield(VALUE self, VALUE obj, VALUE ary) {
   int status = 0;
   VALUE res = rb_protect(rb_yield, obj, &status);
@@ -354,7 +339,6 @@ void Init_kernel_spec(void) { https://github.com/ruby/ruby/blob/trunk/spec/ruby/optional/capi/ext/kernel_spec.c#L339
   rb_define_method(cls, "rb_throw_obj", kernel_spec_rb_throw_obj, 2);
   rb_define_method(cls, "rb_rescue", kernel_spec_rb_rescue, 4);
   rb_define_method(cls, "rb_rescue2", kernel_spec_rb_rescue2, -1);
-  rb_define_method(cls, "rb_rescue2_wrong_arg_type", kernel_spec_rb_rescue2_wrong_terminator_arg_type, -1);
   rb_define_method(cls, "rb_protect_yield", kernel_spec_rb_protect_yield, 2);
   rb_define_method(cls, "rb_protect_null_status", kernel_spec_rb_protect_null_status, 1);
   rb_define_method(cls, "rb_eval_string_protect", kernel_spec_rb_eval_string_protect, 2);
diff --git a/spec/ruby/optional/capi/kernel_spec.rb b/spec/ruby/optional/capi/kernel_spec.rb
index 00a5781..ff88203 100644
--- a/spec/ruby/optional/capi/kernel_spec.rb
+++ b/spec/ruby/optional/capi/kernel_spec.rb
@@ -391,26 +391,6 @@ describe "C-API Kernel function" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/optional/capi/kernel_spec.rb#L391
         @s.rb_rescue2(type_error_proc, :no_exc, proc, :exc, ArgumentError, RuntimeError)
       }.should raise_error(TypeError)
     end
-
-    if false # pending
-      # This spec causes core dump on many platforms:
-      # * https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos7/ruby-master/log/20200328T003002Z.fail.html.gz
-      # * https://rubyci.org/logs/rubyci.s3.amazonaws.com/archlinux/ruby-master/log/20200328T003503Z.fail.html.gz
-      # * https://rubyci.org/logs/rubyci.s3.amazonaws.com/android28-x86_64/ruby-master/log/20200328T014134Z.fail.html.gz
-      # * http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/2829165
-      # * http://ci.rvm.jp/results/trunk_clang_60@silicon-docker/2829309
-      it "works when the terminating argument has not been sizes as a VALUE" do
-        proc = -> x { x }
-        arg_error_proc = -> *_ { raise ArgumentError, '' }
-        run_error_proc = -> *_ { raise RuntimeError, '' }
-        type_error_proc = -> *_ { raise TypeError, '' }
-        @s.rb_rescue2_wrong_arg_type(arg_error_proc, :no_exc, proc, :exc, ArgumentError, RuntimeError).should == :exc
-        @s.rb_rescue2_wrong_arg_type(run_error_proc, :no_exc, proc, :exc, ArgumentError, RuntimeError).should == :exc
-        -> {
-          @s.rb_rescue2_wrong_arg_type(type_error_proc, :no_exc, proc, :exc, ArgumentError, RuntimeError)
-        }.should raise_error(TypeError)
-      end
-    end
   end
 
   describe "rb_catch" do
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]