mjit.h: compare as pointer

* 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
parent 381650ea58
commit 8fd16730f0
2 changed files with 2 additions and 2 deletions

2
mjit.c
View File

@ -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
View File

@ -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);
}