summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-22 09:12:24 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-22 09:12:24 +0000
commitdef42c9a0cd274202da56531c19e0a4bee3364e3 (patch)
treeb100f68b08e5f1ae5338055ae798320a4a339e01 /hash.c
parentef8e0b4dffaec6789a1582d841ddb563cac2115d (diff)
* eval.c (rb_yield_0): no mvalue_to_svalue conversion here.
* eval.c (massign): takes svalue, convert it to mvalue inside. * eval.c (rb_eval): parameters for yield/return are always svalues now. * eval.c (svalue_to_mvalue): more strict conversion. * eval.c (mvalue_to_svalue): ditto. * st.c (new_size): prime hash size enabled. * ext/socket/socket.c (Init_socket): SO_* constants added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hash.c b/hash.c
index 39a9a52..c8d2857 100644
--- a/hash.c
+++ b/hash.c
@@ -668,7 +668,8 @@ static VALUE
rb_hash_inspect(hash)
VALUE hash;
{
- if (RHASH(hash)->tbl->num_entries == 0) return rb_str_new2("{}");
+ if (RHASH(hash)->tbl == 0 || RHASH(hash)->tbl->num_entries == 0)
+ return rb_str_new2("{}");
if (rb_inspecting_p(hash)) return rb_str_new2("{...}");
return rb_protect_inspect(inspect_hash, hash, 0);
}