aboutsummaryrefslogtreecommitdiffstats
path: root/mjit.h
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-02-18 12:39:30 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-02-20 11:46:54 +0900
commit6788c375b15232e684dbd4b993b508413f2c74a9 (patch)
tree3cbff8ac502b39a9272a799e346d61faaf650c97 /mjit.h
parent036a68ae2c6f3214cb5488da412444d773cbb65d (diff)
downloadruby-6788c375b15232e684dbd4b993b508413f2c74a9.tar.gz
suppress clang warnings
Starting clang 11, casts between pointer and (narrower-than-pointer) int are now warned. However all such thing in our repository are guaranteed safe. Let's suppress the warnings.
Diffstat (limited to 'mjit.h')
-rw-r--r--mjit.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/mjit.h b/mjit.h
index 44cb6571b7..bdc186f788 100644
--- a/mjit.h
+++ b/mjit.h
@@ -125,13 +125,15 @@ mjit_exec(rb_execution_context_t *ec)
total_calls = ++body->total_calls;
func = body->jit_func;
- if (UNLIKELY((uintptr_t)func <= (uintptr_t)LAST_JIT_ISEQ_FUNC)) {
+ uintptr_t func_i = (uintptr_t)func;
+ if (UNLIKELY(func_i <= LAST_JIT_ISEQ_FUNC)) {
# ifdef MJIT_HEADER
RB_DEBUG_COUNTER_INC(mjit_frame_JT2VM);
# else
RB_DEBUG_COUNTER_INC(mjit_frame_VM2VM);
# endif
- switch ((enum rb_mjit_iseq_func)func) {
+ ASSUME(func_i <= LAST_JIT_ISEQ_FUNC);
+ switch ((enum rb_mjit_iseq_func)func_i) {
case NOT_ADDED_JIT_ISEQ_FUNC:
RB_DEBUG_COUNTER_INC(mjit_exec_not_added);
if (total_calls == mjit_opts.min_calls && mjit_target_iseq_p(body)) {