Report unknown --ujit-* options

This commit is contained in:
Maxime Chevalier-Boisvert 2021-01-26 16:19:29 -05:00 committed by Alan Wu
parent b7f93e81df
commit a14015e9b5
2 changed files with 5 additions and 0 deletions

4
ruby.c
View File

@ -1041,6 +1041,10 @@ setup_ujit_options(const char *s, struct rb_ujit_options *ujit_opt)
if (opt_match_noarg(s, l, "stats")) { if (opt_match_noarg(s, l, "stats")) {
ujit_opt->gen_stats = true; ujit_opt->gen_stats = true;
} }
else {
rb_raise(rb_eRuntimeError,
"invalid ujit option `%s' (--help will show valid ujit options)", s);
}
} }
#if USE_MJIT #if USE_MJIT

View File

@ -180,6 +180,7 @@ ujit_gen_block(ctx_t* ctx, block_t* block)
} }
#if RUBY_DEBUG #if RUBY_DEBUG
// Count instructions executed by the JIT
mov(cb, REG0, const_ptr_opnd((void *)&rb_ujit_exec_insns_count)); mov(cb, REG0, const_ptr_opnd((void *)&rb_ujit_exec_insns_count));
add(cb, mem_opnd(64, REG0, 0), imm_opnd(1)); add(cb, mem_opnd(64, REG0, 0), imm_opnd(1));
#endif #endif