summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-30 15:33:03 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-30 15:33:03 +0000
commitc2a9b62fd2f5c107fcff2e21052e4e9e2294e8ce (patch)
treef6ffbb816a1fb52687c289d2e109fb02c32a5352 /enum.c
parente7bb5176f67ac39add861b6539fe40898f2af6c0 (diff)
* string.c (rb_str_locktmp): lock string temporarily.
* string.c (str_independent): add tmplock check. * io.c (io_write): lock output string temporarily. [ruby-dev:24649] * io.c (io_write): use rb_str_locktmp(). * io.c (read_all): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/enum.c b/enum.c
index 2f931c7..a745a6e 100644
--- a/enum.c
+++ b/enum.c
@@ -494,6 +494,9 @@ enum_sort_by(obj)
if (RARRAY(ary)->len > 1) {
qsort(RARRAY(ary)->ptr, RARRAY(ary)->len, sizeof(VALUE), sort_by_cmp, 0);
}
+ if (RBASIC(ary)->klass) {
+ rb_raise(rb_eRuntimeError, "sort_by reentered");
+ }
for (i=0; i<RARRAY(ary)->len; i++) {
RARRAY(ary)->ptr[i] = RNODE(RARRAY(ary)->ptr[i])->u2.value;
}