1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (rb_with_disable_interrupt): use ENABLE_INTS instead of

ALLOW_INTS which may switch context.  [ruby-dev:22319]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-12-22 09:37:13 +00:00
parent d0133e413d
commit 1c09bfad5c
3 changed files with 17 additions and 10 deletions

View file

@ -30,6 +30,9 @@ Mon Dec 22 13:40:19 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
Mon Dec 22 00:32:43 2003 Yukihiro Matsumoto <matz@ruby-lang.org> Mon Dec 22 00:32:43 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* 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 * ext/syck/emitter.c (syck_emitter_write): str bigger than
e->bufsize causes buffer overflow. [ruby-dev:22307] e->bufsize causes buffer overflow. [ruby-dev:22307]

10
eval.c
View file

@ -4733,14 +4733,18 @@ rb_with_disable_interrupt(proc, data)
int status; int status;
DEFER_INTS; DEFER_INTS;
RUBY_CRITICAL( {
int thr_critical = rb_thread_critical;
rb_thread_critical = Qtrue;
PUSH_TAG(PROT_NONE); PUSH_TAG(PROT_NONE);
if ((status = EXEC_TAG()) == 0) { if ((status = EXEC_TAG()) == 0) {
result = (*proc)(data); result = (*proc)(data);
} }
POP_TAG(); POP_TAG();
); rb_thread_critical = thr_critical;
ALLOW_INTS; }
ENABLE_INTS;
if (status) JUMP_TAG(status); if (status) JUMP_TAG(status);
return result; return result;

14
hash.c
View file

@ -46,13 +46,6 @@ VALUE rb_cHash;
static VALUE envtbl; static VALUE envtbl;
static ID id_hash, id_call, id_default; static ID id_hash, id_call, id_default;
VALUE
rb_hash(obj)
VALUE obj;
{
return rb_funcall(obj, id_hash, 0);
}
static VALUE static VALUE
eql(args) eql(args)
VALUE *args; VALUE *args;
@ -84,6 +77,13 @@ rb_any_cmp(a, b)
return !rb_with_disable_interrupt(eql, (VALUE)args); return !rb_with_disable_interrupt(eql, (VALUE)args);
} }
VALUE
rb_hash(obj)
VALUE obj;
{
return rb_funcall(obj, id_hash, 0);
}
static int static int
rb_any_hash(a) rb_any_hash(a)
VALUE a; VALUE a;