Patch for [ruby-core:15551]

e$B%o%J%Y$H?=$7$^$9!#e(B

[ruby-core:15551]e$B$KBP$9$k%Q%C%A$r=q$-$^$7$?!#e(B
Proc#curry e$B$G:n$i$l$?e(B Proc
e$B%*%V%8%’%/%H$K%V%m%C%/$rEO$;$k$h$&$K$7$^$7$?!#e(B

proc_call() e$BCf$Ne(B BUILTIN_TYPE(proc->block.iseq) != T_NODE
e$B$N0UL#$,e(B
e$B$h$/J,$+$i$J$+$C$?$N$G30$7$F$7$^$$$^$7$?$,!“e(B
e$B2?$+FCJL$J0U?^$N$”$k<0$J$N$G$7$g$&$+!#e(B

Index: proc.c

— proc.c (revision 15910)
+++ proc.c (working copy)
@@ -496,8 +496,7 @@
rb_block_t *blockptr = 0;
GetProcPtr(procval, proc);

  • if (BUILTIN_TYPE(proc->block.iseq) != T_NODE &&
  • proc->block.iseq->arg_block != -1) {
  • if (proc->block.iseq->arg_block != -1) {

if (rb_block_given_p()) {
rb_proc_t *proc;
@@ -1620,7 +1619,7 @@
arity = make_curry_proc(proc, passed, arity);
return arity;
}

  • arity = rb_proc_call(proc, passed);
  • arity = proc_call(RARRAY_LEN(passed), RARRAY_PTR(passed), proc);
    return arity;
    }

Index: vm.c

— vm.c (revision 15910)
+++ vm.c (working copy)
@@ -572,7 +572,7 @@
val = vm_eval_body(th);
}
else {

  • val = vm_yield_with_cfunc(th, block, self, argc, argv);
  • val = vm_yield_with_cfunc(th, block, self, argc, argv, blockptr);
    }
    return val;
    }
    Index: vm_insnhelper.c
    ===================================================================
    — vm_insnhelper.c (revision 15910)
    +++ vm_insnhelper.c (working copy)
    @@ -644,7 +644,7 @@

static inline VALUE
vm_yield_with_cfunc(rb_thread_t *th, rb_block_t *block,

  •    VALUE self, int argc, VALUE *argv)
    
  •    VALUE self, int argc, VALUE *argv, rb_block_t *blockptr)
    

{
NODE *ifunc = (NODE *) block->iseq;
VALUE val;
@@ -665,7 +665,15 @@
self, (VALUE)block->dfp,
0, th->cfp->sp, block->lfp, 1);

  • val = (*ifunc->nd_cfnc) (arg, ifunc->nd_tval, argc, argv);
  • if (blockptr) {

  • VALUE store_block = th->cfp->lfp[0];

  • th->cfp->lfp[0] = GC_GUARDED_PTR(blockptr);

  • val = (*ifunc->nd_cfnc) (arg, ifunc->nd_tval, argc, argv);

  • th->cfp->lfp[0] = store_block;

  • }

  • else {

  • val = (*ifunc->nd_cfnc) (arg, ifunc->nd_tval, argc, argv);

  • }

    th->cfp++;
    return val;
    @@ -821,7 +829,7 @@
    return Qundef;
    }
    else {

  • val = vm_yield_with_cfunc(th, block, block->self, argc,
    STACK_ADDR_FROM_TOP(argc));
  • val = vm_yield_with_cfunc(th, block, block->self, argc,
    STACK_ADDR_FROM_TOP(argc), 0);
    POPN(argc); /* TODO: should put before C/yield? */
    return val;
    }

e$B1sF#$H?=$7$^$9!#e(B

08/04/09 e$B$Ke(B wanabe[email protected]alid e$B$5$s$O=q$-$^$7$?e(B:

e$B%o%J%Y$H?=$7$^$9!#e(B

[ruby-core:15551]e$B$KBP$9$k%Q%C%A$r=q$-$^$7$?!#e(B
Proc#curry e$B$G:n$i$l$?e(B Proc e$B%*%V%8%’%/%H$K%V%m%C%/$rEO$;$k$h$&$K$7$^$7$?!#e(B

e$B$$$9$P$i$7$$!#$"$j$,$H$&$4$6$$$^$9!#e(B
e$B<h$j9~$s$G$b$$$$$G$7$g$&$+!#e(B

Proc#curry [email protected]$1$G$J$/!"$3$s$J%3!<%I$bF0$/$h$&$K$J$j$^$9$M!#e(B

“a”.method(:upto).to_proc.call(“c”) {|x| p x }

proc_call() e$BCf$Ne(B BUILTIN_TYPE(proc->block.iseq) != T_NODE e$B$N0UL#$,e(B
e$B$h$/J,$+$i$J$+$C$?$N$G30$7$F$7$^$$$^$7$?$,!“e(B
e$B2?$+FCJL$J0U?^$N$”$k<0$J$N$G$7$g$&$+!#e(B

BUILTIN_TYPE(proc->block.iseq) == T_NODE e$B$N>l9g!“e(Bproc->block.iseq
e$B$Ke(B
iseq e$B$G$J$/e(B NODE_IFUNC e$B$,F~$C$F$$$k$H$$$&[email protected]$H;W$$$^$9!#e(B
e$B$3$N$H$-$Ke(B proc->block.iseq->arg_block
e$B$r;2>H$9$k$N$O$^$:$$$h$&$Je(B
e$BM=46$,$7$^$9$,!”$I$&$J$s$G$7$g$&!#$3$&$9$Y$-!)e(B

Index: proc.c

— proc.c (revision 15949)
+++ proc.c (working copy)
@@ -496,7 +496,7 @@
rb_block_t *blockptr = 0;
GetProcPtr(procval, proc);

  • if (BUILTIN_TYPE(proc->block.iseq) != T_NODE &&
  • if (BUILTIN_TYPE(proc->block.iseq) == T_NODE ||
    proc->block.iseq->arg_block != -1) {

if (rb_block_given_p()) {

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:34307] Re: patch for [ruby-core:15551]”
on Thu, 10 Apr 2008 19:45:07 +0900, “Yusuke ENDOH” [email protected]
writes:

|> [ruby-core:15551]e$B$KBP$9$k%Q%C%A$r=q$-$^$7$?!#e(B
|> Proc#curry e$B$G:n$i$l$?e(B Proc e$B%%V%8%’%/%H$K%V%m%C%/$rEO$;$k$h$&$K$7$^$7$?!#e(B
|
|e$B$
$*$9$P$i$7$$!#$"$j$,$H$&$4$6$$$^$9!#e(B
|e$B<h$j9~$s$G$b$$$$$G$7$g$&$+!#e(B

e$B;d$+$i$b$*4j$$$7$^$9!#e(B

|BUILTIN_TYPE(proc->block.iseq) == T_NODE e$B$N>l9g!“e(Bproc->block.iseq e$B$Ke(B
|iseq e$B$G$J$/e(B NODE_IFUNC e$B$,F~$C$F$$$k$H$$$&[email protected]$H;W$$$^$9!#e(B
|e$B$3$N$H$-$Ke(B proc->block.iseq->arg_block e$B$r;2>H$9$k$N$O$^$:$$$h$&$Je(B
|e$BM=46$,$7$^$9$,!”$I$&$J$s$G$7$g$&!#$3$&$9$Y$-!)e(B

[email protected]$/[email protected]$G$-$J$$$h$&$K;W$$$^$9$,e(B([email protected]$/$se(B
e$B$G$b$G$-$J$$!)e(B)e$B!"$J$s$H$J$/$=$l$G$"$C$F$$$k$h$&$K;W$$$^$9!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs