aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-09 08:59:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-09 08:59:48 +0000
commiteff05531058813e423a3ea77d97f5c4aa7a78dae (patch)
tree2a0259c164d7c8c5707931ab306be7ec0015806d /eval.c
parent856f9141dc89120e26b12ee867559f7c5325bc63 (diff)
downloadruby-eff05531058813e423a3ea77d97f5c4aa7a78dae.tar.gz
thread.c: set cause by Thread#raise
* thread.c (rb_threadptr_raise): set cause from the called thread, but not from the thread to be interrupted. [ruby-core:77222] [Bug #12741] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index bad3c83714..1baf914a3a 100644
--- a/eval.c
+++ b/eval.c
@@ -567,6 +567,17 @@ setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg, VALUE cause)
}
}
+void
+rb_threadptr_setup_exception(rb_thread_t *th, VALUE mesg, VALUE cause)
+{
+ if (cause == Qundef) {
+ cause = get_thread_errinfo(th);
+ }
+ if (cause != mesg) {
+ rb_ivar_set(mesg, id_cause, cause);
+ }
+}
+
static void
rb_longjmp(int tag, volatile VALUE mesg, VALUE cause)
{