From a14015e9b5594bde3ee802eb8c39d08d5b8e8249 Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert Date: Tue, 26 Jan 2021 16:19:29 -0500 Subject: [PATCH] Report unknown --ujit-* options --- ruby.c | 4 ++++ ujit_codegen.c | 1 + 2 files changed, 5 insertions(+) diff --git a/ruby.c b/ruby.c index 55d5bf090c..b5c705002a 100644 --- a/ruby.c +++ b/ruby.c @@ -1041,6 +1041,10 @@ setup_ujit_options(const char *s, struct rb_ujit_options *ujit_opt) if (opt_match_noarg(s, l, "stats")) { ujit_opt->gen_stats = true; } + else { + rb_raise(rb_eRuntimeError, + "invalid ujit option `%s' (--help will show valid ujit options)", s); + } } #if USE_MJIT diff --git a/ujit_codegen.c b/ujit_codegen.c index 010e98ae86..bb0b802fc4 100644 --- a/ujit_codegen.c +++ b/ujit_codegen.c @@ -180,6 +180,7 @@ ujit_gen_block(ctx_t* ctx, block_t* block) } #if RUBY_DEBUG + // Count instructions executed by the JIT mov(cb, REG0, const_ptr_opnd((void *)&rb_ujit_exec_insns_count)); add(cb, mem_opnd(64, REG0, 0), imm_opnd(1)); #endif