Project

General

Profile

Feature #5112 ยป 0001-Remove-inadvertent-symbol-creation-from-send-__send_.patch

jeremyevans0 (Jeremy Evans), 07/28/2011 04:25 PM

View differences:

vm_eval.c
677 677
static VALUE
678 678
send_internal(int argc, const VALUE *argv, VALUE recv, call_type scope)
679 679
{
680
    ID id;
680 681
    VALUE vid;
681 682
    VALUE self = RUBY_VM_PREVIOUS_CONTROL_FRAME(GET_THREAD()->cfp)->self;
682 683
    rb_thread_t *th = GET_THREAD();
......
688 689
    vid = *argv++; argc--;
689 690
    PASS_PASSED_BLOCK_TH(th);
690 691

  
691
    return rb_call0(recv, rb_to_id(vid), argc, argv, scope, self);
692
    id = rb_check_id(&vid);
693
    if (!id) {
694
	if (!rb_method_basic_definition_p(CLASS_OF(recv), idMethodMissing)) {
695
	    id = rb_to_id(vid);
696
	}
697
	else {
698
	    rb_raise(rb_eNoMethodError, "undefined method `%s' for %s", RSTRING_PTR(vid),
699
	                      rb_class2name(CLASS_OF(recv)));
700
	}
701
    }
702
    return rb_call0(recv, id, argc, argv, scope, self);
692 703
}
693 704

  
694 705
/*
vm_insnhelper.c
584 584
		    }
585 585

  
586 586
		    sym = TOPN(i);
587
		    id = SYMBOL_P(sym) ? SYM2ID(sym) : rb_to_id(sym);
587
		    id = SYMBOL_P(sym) ? SYM2ID(sym) : rb_check_id(&sym);
588
		    if (!id) {
589
			if (!rb_method_basic_definition_p(CLASS_OF(recv), idMethodMissing)) {
590
			    id = rb_to_id(sym);
591
			}
592
			else {
593
			    rb_raise(rb_eNoMethodError, "undefined method `%s' for %s", RSTRING_PTR(sym),
594
					      rb_class2name(CLASS_OF(recv)));
595
			}
596
		    }
588 597
		    /* shift arguments */
589 598
		    if (i > 0) {
590 599
			MEMMOVE(&TOPN(i), &TOPN(i-1), VALUE, i);
591
-