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:
parent
cec20793cb
commit
0cc87df01c
2 changed files with 35 additions and 5 deletions
|
@ -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>
|
||||
|
||||
* pack.c (pack_unpack): sign-extend if sizeof long is bigger than
|
||||
|
|
35
eval.c
35
eval.c
|
@ -3826,6 +3826,9 @@ rb_iter_break()
|
|||
NORETURN(static void rb_longjmp _((int, VALUE)));
|
||||
static VALUE make_backtrace _((void));
|
||||
|
||||
static int thread_set_raised();
|
||||
static void thread_reset_raised();
|
||||
|
||||
static void
|
||||
rb_longjmp(tag, mesg)
|
||||
int tag;
|
||||
|
@ -3851,14 +3854,22 @@ rb_longjmp(tag, mesg)
|
|||
}
|
||||
|
||||
if (RTEST(ruby_debug) && !NIL_P(ruby_errinfo)
|
||||
&& !thread_set_raised()
|
||||
&& !rb_obj_is_kind_of(ruby_errinfo, rb_eSystemExit)) {
|
||||
VALUE e = ruby_errinfo;
|
||||
int status;
|
||||
|
||||
StringValue(e);
|
||||
warn_printf("Exception `%s' at %s:%d - %s\n",
|
||||
rb_obj_classname(ruby_errinfo),
|
||||
ruby_sourcefile, ruby_sourceline,
|
||||
RSTRING(e)->ptr);
|
||||
PUSH_TAG(PROT_NONE);
|
||||
if ((status = EXEC_TAG()) == 0) {
|
||||
StringValue(e);
|
||||
warn_printf("Exception `%s' at %s:%d - %s\n",
|
||||
rb_obj_classname(ruby_errinfo),
|
||||
ruby_sourcefile, ruby_sourceline,
|
||||
RSTRING(e)->ptr);
|
||||
}
|
||||
POP_TAG();
|
||||
thread_reset_raised();
|
||||
JUMP_TAG(tag);
|
||||
}
|
||||
|
||||
rb_trap_restore_mask();
|
||||
|
@ -7762,6 +7773,20 @@ struct thread_status_t {
|
|||
(dst)->join = (src)->join, \
|
||||
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 VALUE
|
||||
|
|
Loading…
Reference in a new issue