Project

General

Profile

Bug #10929 ยป block_from_nil.patch

hanachin (Seiei Miyagi), 03/06/2015 01:00 PM

View differences:

bootstraptest/test_block.rb
611 611
  end
612 612
  'ok'
613 613
}
614

  
615
assert_equal 'ok', %q{
616
  class NilClass
617
    def to_proc
618
      Proc.new {|x| x }
619
    end
620
  end
621

  
622
  def foo(&blk)
623
    blk.call('ok')
624
  end
625

  
626
  foo(&nil)
627
}, '[ruby-core:68384] [Bug #10929]'
vm_args.c
755 755

  
756 756
	proc = *(--reg_cfp->sp);
757 757

  
758
	if (proc != Qnil) {
758
	if (proc != Qnil || rb_respond_to(Qnil, idTo_proc)) {
759 759
	    if (!rb_obj_is_proc(proc)) {
760 760
		VALUE b;
761 761