From 00be5846e4793b718da19dafec3f4ecf2d6d0692 Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Tue, 19 Oct 2021 16:43:20 -0400 Subject: Fix non RUBY_DEBUG build warnings On non RUBY_DEBUG builds, assert() compiles to nothing and the compiler warns about uninitialized variables in those code paths. Replace those asserts with rb_bug() to fix the warnings and do the assert in all builds. Since yjit_asm_tests.c compiles outside of Ruby, it needed a distinct version of rb_bug(). Also put YJIT_STATS check for function delcaration that is only defined in YJIT_STATS builds. --- yjit_iface.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'yjit_iface.h') diff --git a/yjit_iface.h b/yjit_iface.h index 5f070fc19f..92443dceb6 100644 --- a/yjit_iface.h +++ b/yjit_iface.h @@ -22,8 +22,10 @@ static VALUE *yjit_iseq_pc_at_idx(const rb_iseq_t *iseq, uint32_t insn_idx); static int yjit_opcode_at_pc(const rb_iseq_t *iseq, const VALUE *pc); static void yjit_print_iseq(const rb_iseq_t *iseq); +#if YJIT_STATS // this function *must* return passed exit_pc static const VALUE *yjit_count_side_exit_op(const VALUE *exit_pc); +#endif static void yjit_unlink_method_lookup_dependency(block_t *block); static void yjit_block_assumptions_free(block_t *block); -- cgit v1.2.3