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 | 646c53895f80358d153d04f04b726d0d14388cf2 (patch) | |
tree | 2a0259c164d7c8c5707931ab306be7ec0015806d /eval.c | |
parent | b5f3a113f55a81ce19c36b50d1ef234ac518d510 (diff) | |
download | ruby-646c53895f80358d153d04f04b726d0d14388cf2.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) { |