summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-20 13:28:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-20 13:28:18 +0000
commit9286180079614b7f953a0c6832ad38c6d5a5af9f (patch)
treeb8d8894e8a76bb8d5c4c8350840ebe3294735597 /proc.c
parent51e0bcb72a332b121c524e926f0b08994fc963aa (diff)
* proc.c (proc_new): use the given class.
* vm.c (vm_make_proc): added an argument for the class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/proc.c b/proc.c
index 3bcb6cfbc8..710ab065d1 100644
--- a/proc.c
+++ b/proc.c
@@ -379,11 +379,12 @@ proc_new(VALUE klass, int is_lambda)
}
}
- if (block->proc) {
- return block->proc;
+ procval = block->proc;
+ if (procval && RBASIC(procval)->klass == klass) {
+ return procval;
}
- procval = vm_make_proc(th, cfp, block);
+ procval = vm_make_proc(th, cfp, block, klass);
if (is_lambda) {
rb_proc_t *proc;