aboutsummaryrefslogtreecommitdiffstats
path: root/eval_error.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-23 03:23:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-23 03:23:28 +0000
commit91ba45ba5b3cd2ccc1457e4907cf6ed61b48ec04 (patch)
tree1e26d10ad114b7ecda1476a39935a6847f48b5db /eval_error.c
parentd1bf3bbd48feb89a183c012b13055eab9c4fe747 (diff)
downloadruby-91ba45ba5b3cd2ccc1457e4907cf6ed61b48ec04.tar.gz
eval_error.c: reuse threadptr
* eval_error.c (error_print, error_handle): reuse same threadptr by passing as an argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_error.c')
-rw-r--r--eval_error.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/eval_error.c b/eval_error.c
index 69090fdf50..c3e7c25e67 100644
--- a/eval_error.c
+++ b/eval_error.c
@@ -87,10 +87,9 @@ set_backtrace(VALUE info, VALUE bt)
}
static void
-error_print(void)
+error_print(rb_thread_t *th)
{
volatile VALUE errat = Qundef;
- rb_thread_t *th = GET_THREAD();
VALUE errinfo = th->errinfo;
int raised_flag = th->raised_flag;
volatile VALUE eclass = Qundef, e = Qundef;
@@ -200,7 +199,7 @@ error_print(void)
void
ruby_error_print(void)
{
- error_print();
+ error_print(GET_THREAD());
}
#define undef_mesg_for(v, k) rb_fstring_cstr("undefined"v" method `%1$s' for "k" `%2$s'")
@@ -301,7 +300,7 @@ error_handle(int ex)
warn_print("unexpected throw\n");
break;
case TAG_RAISE: {
- VALUE errinfo = GET_THREAD()->errinfo;
+ VALUE errinfo = th->errinfo;
if (rb_obj_is_kind_of(errinfo, rb_eSystemExit)) {
status = sysexit_status(errinfo);
}
@@ -310,12 +309,12 @@ error_handle(int ex)
/* no message when exiting by signal */
}
else {
- error_print();
+ error_print(th);
}
break;
}
case TAG_FATAL:
- error_print();
+ error_print(th);
break;
default:
unknown_longjmp_status(ex);