summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-21 09:35:29 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-21 09:35:29 +0000
commitba19ba779cc232474d75eb190e7420bf667832dc (patch)
treeac9f317f71df73b44ce9a4b0b485f6df646d44bc /hash.c
parentde5a85496ac4ae7bd24b5fc7acb8001a5e4d8b7d (diff)
* array.c (rb_ary_uniq_bang): element size might change during
comparison. [ruby-dev:24298] * enum.c (enum_sort_by): do not use qsort directly. use rb_ary_sort_bang() instead. [ruby-dev:24291] * enum.c (enum_sort_by): pedantic type check added. [ruby-dev:24291] * hash.c (rb_hash_foreach_iter): check iter_lev after each iteration. [ruby-dev:24289] * array.c (rb_ary_and): element size might change during comparison. [ruby-dev:24290] * array.c (rb_ary_or): ditto. [ruby-dev:24292] * array.c (rb_ary_equal): wrong fix. [ruby-dev:24286] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hash.c b/hash.c
index 209fe26..89666ca 100644
--- a/hash.c
+++ b/hash.c
@@ -131,9 +131,13 @@ rb_hash_foreach_iter(key, value, arg)
if (key == Qundef) return ST_CONTINUE;
status = (*arg->func)(key, value, arg->arg);
- if (RHASH(arg->hash)->tbl != tbl || RHASH(arg->hash)->tbl->bins != bins){
+ if (RHASH(arg->hash)->tbl != tbl ||
+ RHASH(arg->hash)->tbl->bins != bins) {
rb_raise(rb_eIndexError, "rehash occurred during iteration");
}
+ if (RHASH(arg->hash)->iter_lev == 0) {
+ rb_raise(rb_eArgError, "block re-entered");
+ }
return status;
}