From e176f84138ff4fc5f7442cc969a281aeb714e7bd Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Fri, 4 Aug 2023 20:36:02 -0700 Subject: [PATCH] Just suppress a warning for non-Emscripten Wasm build Revert "Revert "Skip calling jit_exec on Wasm"" This reverts commit 2e94610f70baca4af004202f288a6b5dd10889ca. It's not about whether it's optimized away or not. I just don't want to leave and maintain the callsite (e.g. signature) in the path where YJIT is never built. --- vm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vm.c b/vm.c index f67bd30bdd..325ab9935e 100644 --- a/vm.c +++ b/vm.c @@ -422,7 +422,7 @@ jit_exec(rb_execution_context_t *ec) } #else static inline rb_jit_func_t jit_compile(rb_execution_context_t *ec) { return 0; } -static inline VALUE jit_exec(rb_execution_context_t *ec) { return Qundef; } +RBIMPL_ATTR_MAYBE_UNUSED() static inline VALUE jit_exec(rb_execution_context_t *ec) { return Qundef; } #endif #include "vm_insnhelper.c" @@ -2336,9 +2336,7 @@ vm_exec_bottom_main(void *context) struct rb_vm_exec_context *ctx = (struct rb_vm_exec_context *)context; ctx->state = TAG_NONE; - if (UNDEF_P(ctx->result = jit_exec(ctx->ec))) { - ctx->result = vm_exec_core(ctx->ec); - } + ctx->result = vm_exec_core(ctx->ec); vm_exec_enter_vm_loop(ctx->ec, ctx, ctx->tag, true); }