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

* eval.c (rb_longjmp): get rid of reentering while debug warning.

(ruby-bugs-ja:PR473)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2003-05-23 09:34:09 +00:00
parent cec20793cb
commit 0cc87df01c
2 changed files with 35 additions and 5 deletions

View file

@ -1,3 +1,8 @@
Fri May 23 18:34:05 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* eval.c (rb_longjmp): get rid of reentering while debug warning.
(ruby-bugs-ja:PR473)
Fri May 23 15:16:16 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net> Fri May 23 15:16:16 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* pack.c (pack_unpack): sign-extend if sizeof long is bigger than * pack.c (pack_unpack): sign-extend if sizeof long is bigger than

35
eval.c
View file

@ -3826,6 +3826,9 @@ rb_iter_break()
NORETURN(static void rb_longjmp _((int, VALUE))); NORETURN(static void rb_longjmp _((int, VALUE)));
static VALUE make_backtrace _((void)); static VALUE make_backtrace _((void));
static int thread_set_raised();
static void thread_reset_raised();
static void static void
rb_longjmp(tag, mesg) rb_longjmp(tag, mesg)
int tag; int tag;
@ -3851,14 +3854,22 @@ rb_longjmp(tag, mesg)
} }
if (RTEST(ruby_debug) && !NIL_P(ruby_errinfo) if (RTEST(ruby_debug) && !NIL_P(ruby_errinfo)
&& !thread_set_raised()
&& !rb_obj_is_kind_of(ruby_errinfo, rb_eSystemExit)) { && !rb_obj_is_kind_of(ruby_errinfo, rb_eSystemExit)) {
VALUE e = ruby_errinfo; VALUE e = ruby_errinfo;
int status;
StringValue(e); PUSH_TAG(PROT_NONE);
warn_printf("Exception `%s' at %s:%d - %s\n", if ((status = EXEC_TAG()) == 0) {
rb_obj_classname(ruby_errinfo), StringValue(e);
ruby_sourcefile, ruby_sourceline, warn_printf("Exception `%s' at %s:%d - %s\n",
RSTRING(e)->ptr); rb_obj_classname(ruby_errinfo),
ruby_sourcefile, ruby_sourceline,
RSTRING(e)->ptr);
}
POP_TAG();
thread_reset_raised();
JUMP_TAG(tag);
} }
rb_trap_restore_mask(); rb_trap_restore_mask();
@ -7762,6 +7773,20 @@ struct thread_status_t {
(dst)->join = (src)->join, \ (dst)->join = (src)->join, \
0) 0)
static int
thread_set_raised()
{
if (curr_thread->flags & THREAD_RAISED) return 1;
curr_thread->flags |= THREAD_RAISED;
return 0;
}
static void
thread_reset_raised()
{
curr_thread->flags &= ~THREAD_RAISED;
}
static void rb_thread_ready _((rb_thread_t)); static void rb_thread_ready _((rb_thread_t));
static VALUE static VALUE