зеркало из https://github.com/github/ruby.git
Remove spec which is an incorrect usage of rb_rescue2()
* It segfaults on MRI.
This commit is contained in:
Родитель
34b0a7be0e
Коммит
282c9d1bbe
|
@ -180,21 +180,6 @@ VALUE kernel_spec_rb_rescue2(int argc, VALUE *args, VALUE self) {
|
|||
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) {
|
|||
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);
|
||||
|
|
|
@ -391,26 +391,6 @@ describe "C-API Kernel function" do
|
|||
@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
|
||||
|
|
Загрузка…
Ссылка в новой задаче