1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

If --yjit-stats is given without RUBY_DEBUG, that should be an error.

This commit is contained in:
Noah Gibbs 2021-06-14 12:07:27 +01:00 committed by Alan Wu
parent 364cdda0f1
commit d1d3d2c0aa

View file

@ -1025,6 +1025,7 @@ rb_yjit_call_threshold(void)
return rb_yjit_opts.call_threshold;
}
// Can raise RuntimeError
void
rb_yjit_init(struct rb_yjit_options *options)
{
@ -1037,6 +1038,12 @@ rb_yjit_init(struct rb_yjit_options *options)
rb_yjit_opts.gen_stats |= !!getenv("YJIT_STATS");
#if !RUBY_DEBUG
if(rb_yjit_opts.gen_stats) {
rb_raise(rb_eRuntimeError, "--yjit-stats requires that Ruby is compiled with CPPFLAGS='-DRUBY_DEBUG=1'");
}
#endif
// Normalize command-line options to default values
if (rb_yjit_opts.exec_mem_size < 1) {
rb_yjit_opts.exec_mem_size = 256;