1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

RUBY_VM_CHECK_INTS: eval the argument only once

* vm_core.h (RUBY_VM_CHECK_INTS): evaluate the argument only once
  to get rid of inadvertent side effects.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-07-17 07:28:53 +00:00
parent ce7fdcf0f8
commit df62161d7e

View file

@ -1090,11 +1090,14 @@ void rb_threadptr_pending_interrupt_clear(rb_thread_t *th);
void rb_threadptr_pending_interrupt_enque(rb_thread_t *th, VALUE v); void rb_threadptr_pending_interrupt_enque(rb_thread_t *th, VALUE v);
int rb_threadptr_pending_interrupt_active_p(rb_thread_t *th); int rb_threadptr_pending_interrupt_active_p(rb_thread_t *th);
#define RUBY_VM_CHECK_INTS(th) do { \ #define RUBY_VM_CHECK_INTS(th) ruby_vm_check_ints(th)
if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(th))) { \ static inline void
rb_threadptr_execute_interrupts(th, 0); \ ruby_vm_check_ints(rb_thread_t *th)
} \ {
} while (0) if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(th))) {
rb_threadptr_execute_interrupts(th, 0);
}
}
/* tracer */ /* tracer */
struct rb_trace_arg_struct { struct rb_trace_arg_struct {