summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-26 09:28:35 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-26 09:28:35 +0000
commit521af835583fba7793650c2a9203c43f31800642 (patch)
tree47bb922ab6041080e8edb13394a7ee3499164c05 /signal.c
parent458796d4f1dfef954f570c9b8355088b88d8f895 (diff)
downloadruby-521af835583fba7793650c2a9203c43f31800642.tar.gz
* signal.c (signal_exec): add volatile to make sure setjmp safe.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/signal.c b/signal.c
index ea82faf500..713e5cd5b6 100644
--- a/signal.c
+++ b/signal.c
@@ -624,7 +624,7 @@ static void
signal_exec(VALUE cmd, int safe, int sig)
{
rb_thread_t *cur_th = GET_THREAD();
- int old_in_trap = cur_th->in_trap;
+ volatile int old_in_trap = cur_th->in_trap;
int state;
cur_th->in_trap = 1;
@@ -634,6 +634,7 @@ signal_exec(VALUE cmd, int safe, int sig)
rb_eval_cmd(cmd, rb_ary_new3(1, signum), safe);
}
TH_POP_TAG();
+ cur_th = GET_THREAD();
cur_th->in_trap = old_in_trap;
if (state) {