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_codegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'yjit_codegen.c') diff --git a/yjit_codegen.c b/yjit_codegen.c index 54fb6df2c1..3b39c043b5 100644 --- a/yjit_codegen.c +++ b/yjit_codegen.c @@ -1455,7 +1455,7 @@ jit_chain_guard(enum jcc_kinds jcc, jitstate_t *jit, const ctx_t *ctx, uint8_t d target0_gen_fn = gen_jbe_to_target0; break; default: - RUBY_ASSERT(false && "unimplemented jump kind"); + rb_bug("yjit: unimplemented jump kind"); break; }; -- cgit v1.2.3