summaryrefslogtreecommitdiff
path: root/yjit_iface.c
diff options
context:
space:
mode:
authorNoah Gibbs <noah.gibbs@shopify.com>2021-06-14 12:07:27 +0100
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:36 -0400
commitd1d3d2c0aab39511258c5c75b34396601a94f6f5 (patch)
tree5293d679d5ae906c9c84bb9c08ae426cddc6295e /yjit_iface.c
parent364cdda0f1b63ac0e541ed73a3185a26d309e4da (diff)
If --yjit-stats is given without RUBY_DEBUG, that should be an error.
Diffstat (limited to 'yjit_iface.c')
-rw-r--r--yjit_iface.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/yjit_iface.c b/yjit_iface.c
index 36f0819d7d..6ed1587560 100644
--- a/yjit_iface.c
+++ b/yjit_iface.c
@@ -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;