Project

General

Profile

Backport #7658 » vm.c.patch

eitoball (Eito Katagiri), 01/06/2013 03:44 PM

View differences:

vm.c
468 468
}
469 469

  
470 470
static VALUE vm_make_proc_from_block(rb_thread_t *th, rb_block_t *block);
471
static VALUE vm_make_env_object(rb_thread_t * th, rb_control_frame_t *cfp, VALUE *blockprocptr);
471 472

  
472 473
VALUE
473 474
rb_vm_make_env_object(rb_thread_t * th, rb_control_frame_t *cfp)
474 475
{
476
    VALUE blockprocval;
477
    return vm_make_env_object(th, cfp, &blockprocval);
478
}
479

  
480
VALUE
481
vm_make_env_object(rb_thread_t * th, rb_control_frame_t *cfp, VALUE *blockprocptr)
482
{
475 483
    VALUE envval;
476 484
    VALUE *lfp;
477 485
    rb_block_t *blockptr;
......
489 497
	rb_proc_t *p;
490 498
	GetProcPtr(blockprocval, p);
491 499
	lfp[0] = GC_GUARDED_PTR(&p->block);
500
  *blockprocptr = blockprocval;
492 501
    }
493 502

  
494 503
    envval = vm_make_env_each(th, cfp, cfp->dfp, cfp->lfp);
......
559 568
	rb_bug("rb_vm_make_proc: Proc value is already created.");
560 569
    }
561 570

  
562
    envval = rb_vm_make_env_object(th, cfp);
571
    envval = vm_make_env_object(th, cfp, &blockprocval);
563 572

  
564 573
    if (PROCDEBUG) {
565 574
	check_env_value(envval);