aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-14 05:11:02 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-14 05:11:02 +0000
commit268ca5ee90b3c0d201f774fb94f13a3b1122cfea (patch)
tree49ba66b8ca28183394de62921c1b4cf4aafdcf82
parent005d04b11519f5cdc578aa95c03ba27d1736529a (diff)
downloadruby-268ca5ee90b3c0d201f774fb94f13a3b1122cfea.tar.gz
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
-rw-r--r--mjit.c2
-rw-r--r--mjit.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/mjit.c b/mjit.c
index c993064aea..7bbc30f6c0 100644
--- a/mjit.c
+++ b/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");
diff --git a/mjit.h b/mjit.h
index 1a9f0ec6c7..9bf2a00913 100644
--- a/mjit.h
+++ b/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);
}