diff options
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -142,7 +142,11 @@ hash_recursive(VALUE obj, VALUE arg, int recurse) VALUE rb_hash(VALUE obj) { - VALUE hval = rb_exec_recursive_outer(hash_recursive, obj, 0); + VALUE hval = rb_check_funcall_basic_kw(obj, id_hash, rb_mKernel, 0, 0, 0); + + if (hval == Qundef) { + hval = rb_exec_recursive_outer(hash_recursive, obj, 0); + } while (!FIXNUM_P(hval)) { if (RB_TYPE_P(hval, T_BIGNUM)) { |