diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-09 08:59:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-09 08:59:48 +0000 |
commit | eff05531058813e423a3ea77d97f5c4aa7a78dae (patch) | |
tree | 2a0259c164d7c8c5707931ab306be7ec0015806d /eval.c | |
parent | 856f9141dc89120e26b12ee867559f7c5325bc63 (diff) | |
download | ruby-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.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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) { |