summaryrefslogtreecommitdiff
path: root/eval_error.c
diff options
context:
space:
mode:
authorwanabe <wanabe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-21 14:43:58 +0000
committerwanabe <wanabe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-21 14:43:58 +0000
commit99299e1961202fa396def185f4db2d6f4711dce3 (patch)
treefc6933ec10e7377e6c33e5ae353d8537ec71f580 /eval_error.c
parentd31350f827b02bbbd5154e8a34cbe55c49240af9 (diff)
* 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/trunk@28368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_error.c')
-rw-r--r--eval_error.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/eval_error.c b/eval_error.c
index 46a0705..41fcbb0 100644
--- a/eval_error.c
+++ b/eval_error.c
@@ -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