diff --git a/ChangeLog b/ChangeLog index bcb37ee50e..cc12e21813 100644 --- a/ChangeLog +++ b/ChangeLog @@ -30,6 +30,9 @@ Mon Dec 22 13:40:19 2003 NAKAMURA, Hiroshi Mon Dec 22 00:32:43 2003 Yukihiro Matsumoto + * eval.c (rb_with_disable_interrupt): use ENABLE_INTS instead of + ALLOW_INTS which may switch context. [ruby-dev:22319] + * ext/syck/emitter.c (syck_emitter_write): str bigger than e->bufsize causes buffer overflow. [ruby-dev:22307] diff --git a/eval.c b/eval.c index 545d678be2..8d19602c4f 100644 --- a/eval.c +++ b/eval.c @@ -4733,14 +4733,18 @@ rb_with_disable_interrupt(proc, data) int status; DEFER_INTS; - RUBY_CRITICAL( + { + int thr_critical = rb_thread_critical; + + rb_thread_critical = Qtrue; PUSH_TAG(PROT_NONE); if ((status = EXEC_TAG()) == 0) { result = (*proc)(data); } POP_TAG(); - ); - ALLOW_INTS; + rb_thread_critical = thr_critical; + } + ENABLE_INTS; if (status) JUMP_TAG(status); return result; diff --git a/hash.c b/hash.c index 102682c0b3..36fbed0e54 100644 --- a/hash.c +++ b/hash.c @@ -46,13 +46,6 @@ VALUE rb_cHash; static VALUE envtbl; static ID id_hash, id_call, id_default; -VALUE -rb_hash(obj) - VALUE obj; -{ - return rb_funcall(obj, id_hash, 0); -} - static VALUE eql(args) VALUE *args; @@ -84,6 +77,13 @@ rb_any_cmp(a, b) return !rb_with_disable_interrupt(eql, (VALUE)args); } +VALUE +rb_hash(obj) + VALUE obj; +{ + return rb_funcall(obj, id_hash, 0); +} + static int rb_any_hash(a) VALUE a;