diff --git a/ChangeLog b/ChangeLog index 0046e22e0d..fd1c215793 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Wed Mar 4 00:44:56 2015 Nobuyoshi Nakada + + * thread.c (rb_thread_io_blocking_region): assigned variables + inside EXEC_TAG() should be volatile. + + * thread.c (rb_thread_s_handle_interrupt): ditto. + + * thread.c (exec_recursive): ditto. + Wed Mar 4 00:29:18 2015 NAKAMURA Usaku * tool/redmine-backporter.rb: now can specify shorten form of commands. diff --git a/thread.c b/thread.c index 4ac93e85a1..4f533d039d 100644 --- a/thread.c +++ b/thread.c @@ -1386,9 +1386,9 @@ rb_thread_call_without_gvl(void *(*func)(void *data), void *data1, VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd) { - VALUE val = Qundef; /* shouldn't be used */ + volatile VALUE val = Qundef; /* shouldn't be used */ rb_thread_t *th = GET_THREAD(); - int saved_errno = 0; + volatile int saved_errno = 0; int state; th->waiting_fd = fd; @@ -1787,7 +1787,7 @@ rb_thread_s_handle_interrupt(VALUE self, VALUE mask_arg) { VALUE mask; rb_thread_t *th = GET_THREAD(); - VALUE r = Qnil; + volatile VALUE r = Qnil; int state; if (!rb_block_given_p()) { @@ -4859,10 +4859,11 @@ exec_recursive(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE pairid, VALUE } } else { + volatile VALUE ret = Qundef; recursive_push(p.list, p.objid, p.pairid); PUSH_TAG(); if ((state = EXEC_TAG()) == 0) { - result = (*func)(obj, arg, FALSE); + ret = (*func)(obj, arg, FALSE); } POP_TAG(); if (!recursive_pop(p.list, p.objid, p.pairid)) { @@ -4872,6 +4873,7 @@ exec_recursive(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE pairid, VALUE sym, rb_thread_current()); } if (state) JUMP_TAG(state); + result = ret; } } *(volatile struct exec_recursive_params *)&p;