* mjit.c (mjit_get_iseq_func), mjit.h (mjit_exec): do not compare
  a pointer as shorter type.  by loosing the precision, different
  values can result in "equal" wrongly.  enum type is an alias of
  `int`, and is often shorter than a pointer type nowadays.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-02-14 05:11:02 +00:00
Родитель 381650ea58
Коммит 8fd16730f0
2 изменённых файлов: 2 добавлений и 2 удалений

2
mjit.c
Просмотреть файл

@ -1123,7 +1123,7 @@ mjit_get_iseq_func(const struct rb_iseq_constant_body *body)
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = 1000;
while ((enum rb_mjit_iseq_func)body->jit_func == NOT_READY_JIT_ISEQ_FUNC) {
while (body->jit_func == (mjit_func_t)NOT_READY_JIT_ISEQ_FUNC) {
CRITICAL_SECTION_START(3, "in mjit_get_iseq_func for a client wakeup");
rb_native_cond_broadcast(&mjit_worker_wakeup);
CRITICAL_SECTION_FINISH(3, "in mjit_get_iseq_func for a client wakeup");

2
mjit.h
Просмотреть файл

@ -103,7 +103,7 @@ mjit_exec(rb_execution_context_t *ec)
func = body->jit_func;
if (UNLIKELY(mjit_opts.wait && mjit_opts.min_calls == total_calls && mjit_target_iseq_p(body)
&& (enum rb_mjit_iseq_func)func == NOT_ADDED_JIT_ISEQ_FUNC)) {
&& func == (mjit_func_t)NOT_ADDED_JIT_ISEQ_FUNC)) {
mjit_add_iseq_to_process(iseq);
func = mjit_get_iseq_func(body);
}