diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/codedump.c | 6 | ||||
| -rw-r--r-- | src/hash.c | 10 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/codedump.c b/src/codedump.c index e70df3205..524f0b9e1 100644 --- a/src/codedump.c +++ b/src/codedump.c @@ -545,8 +545,10 @@ codedump_recur(mrb_state *mrb, const mrb_irep *irep) int i; codedump(mrb, irep); - for (i=0; i<irep->rlen; i++) { - codedump_recur(mrb, irep->reps[i]); + if (irep->reps) { + for (i=0; i<irep->rlen; i++) { + codedump_recur(mrb, irep->reps[i]); + } } } #endif diff --git a/src/hash.c b/src/hash.c index b049111b6..b800a251a 100644 --- a/src/hash.c +++ b/src/hash.c @@ -29,8 +29,8 @@ * * [HT] * Hash Table Implementation. The structure of `Hash` that has IB and is - * searched by hash table algorithm. It is used when `Hash` > 16. Collision - * resolution strategy is open addressing method. + * searched by hash table algorithm. It is used when `Hash` size > 16. + * Collision resolution strategy is open addressing method. * * [size] * The number of `Hash` entries (value of `Hash#size`). @@ -1522,8 +1522,8 @@ mrb_hash_size(mrb_state *mrb, mrb_value hash) /* 15.2.13.4.25 */ /* * call-seq: - * hsh.length -> fixnum - * hsh.size -> fixnum + * hsh.length -> integer + * hsh.size -> integer * * Returns the number of key-value pairs in the hash. * @@ -1536,7 +1536,7 @@ static mrb_value mrb_hash_size_m(mrb_state *mrb, mrb_value self) { mrb_int size = mrb_hash_size(mrb, self); - return mrb_fixnum_value(size); + return mrb_int_value(mrb, size); } MRB_API mrb_bool |
