mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
backport r28368:
* eval_error.c (error_print): clear raised_flag while error-printing to avoid hang. [ruby-core:27608] * test/ruby/test_beginendblock.rb (test_endblock_raise): add test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a7a26fe56b
commit
71fecd39f8
3 changed files with 29 additions and 1 deletions
|
@ -67,13 +67,16 @@ static void
|
|||
error_print(void)
|
||||
{
|
||||
volatile VALUE errat = Qnil; /* OK */
|
||||
VALUE errinfo = GET_THREAD()->errinfo;
|
||||
rb_thread_t *th = GET_THREAD();
|
||||
VALUE errinfo = th->errinfo;
|
||||
int raised_flag = th->raised_flag;
|
||||
volatile VALUE eclass, e;
|
||||
const char *volatile einfo;
|
||||
volatile long elen;
|
||||
|
||||
if (NIL_P(errinfo))
|
||||
return;
|
||||
rb_thread_raised_clear(th);
|
||||
|
||||
PUSH_TAG();
|
||||
if (EXEC_TAG() == 0) {
|
||||
|
@ -179,6 +182,7 @@ error_print(void)
|
|||
}
|
||||
error:
|
||||
POP_TAG();
|
||||
rb_thread_raised_set(th, raised_flag);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue