summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-16 02:22:17 +0000
committerglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-16 02:22:17 +0000
commit7317bda66a937464e733e4356ee1f3db3cb005f0 (patch)
tree321b89f435bc0ab17fb03cce3bd10127ef05d26f
parentf3a63c31756032d9d0e6ad07f263fe0de0c97212 (diff)
* 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
-rw-r--r--ChangeLog4
-rw-r--r--proc.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 176b97bdb08..fa969d62309 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Jul 16 11:12:03 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * proc.c (rb_block_arity): raise ArgumentError if no block given.
+
Tue Jul 16 08:15:22 2013 Zachary Scott <e@zzak.io>
* ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] document top-level
diff --git a/proc.c b/proc.c
index 63bed7257ef..bcdcb3607cf 100644
--- a/proc.c
+++ b/proc.c
@@ -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);