diff options
author | glass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-16 02:22:17 +0000 |
---|---|---|
committer | glass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-16 02:22:17 +0000 |
commit | 7317bda66a937464e733e4356ee1f3db3cb005f0 (patch) | |
tree | 321b89f435bc0ab17fb03cce3bd10127ef05d26f /proc.c | |
parent | f3a63c31756032d9d0e6ad07f263fe0de0c97212 (diff) | |
download | ruby-7317bda66a937464e733e4356ee1f3db3cb005f0.tar.gz |
* proc.c (rb_block_arity): raise ArgumentError if no block given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -722,9 +722,11 @@ rb_block_arity(void) rb_thread_t *th = GET_THREAD(); rb_control_frame_t *cfp = th->cfp; rb_block_t *block = rb_vm_control_frame_block_ptr(cfp); - VALUE proc_value = block->proc; + VALUE proc_value; + if (!block) rb_raise(rb_eArgError, "no block given"); min = rb_block_min_max_arity(block, &max); + proc_value = block->proc; if (proc_value) { rb_proc_t *proc; GetProcPtr(proc_value, proc); |