summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-10 01:08:15 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-10 01:08:15 +0000
commit672549bb47cdf3ccbd6d91697941dadf7328617e (patch)
tree8edb1a59d129300539245135b80194271cf63870 /hash.c
parent021336c36f9154b71bcd4a3cd9f18dcf73e1e6c9 (diff)
* eval.c (proc_invoke): should not overwrite block information in
current frame. [ruby-dev:28957] * eval.c (rb_yield_0): retrieve proper block object from the frame record. * eval.c (proc_alloc): return preserved block object if it's available. * st.h (st_data_t): use pointer sized integer for st_data_t. [ruby-dev:28988] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index b945042983..4afba8b624 100644
--- a/hash.c
+++ b/hash.c
@@ -474,6 +474,7 @@ rb_hash_default(int argc, VALUE *argv, VALUE hash)
rb_scan_args(argc, argv, "01", &key);
if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
+ if (argc == 0) return Qnil;
return rb_funcall(RHASH(hash)->ifnone, id_yield, 2, hash, key);
}
return RHASH(hash)->ifnone;