summaryrefslogtreecommitdiff
path: root/cont.c
diff options
context:
space:
mode:
authorKJ Tsanaktsidis <[email protected]>2024-02-17 17:30:34 +1100
committerKJ Tsanaktsidis <[email protected]>2024-03-04 13:07:26 +1100
commit5621d794a2fa9293d1da489d6b0ee0e7c73c9128 (patch)
tree26ebde760fb21ee77110a90295b8ac62eabbf9ce /cont.c
parent0d9a681eff867b569a31ab4f85a43ce53712a9cd (diff)
Disable callcc when ASAN is enabled
callcc's implementation is fundamentally incompatible with ASAN. Since callcc is deprecated and almost never used, it's probably OK to disable callcc when ruby is compiled with ASAN. [Bug #20273]
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cont.c b/cont.c
index cccca9d884..5a805cc1ac 100644
--- a/cont.c
+++ b/cont.c
@@ -1775,6 +1775,13 @@ rb_callcc(VALUE self)
return rb_yield(val);
}
}
+#ifdef RUBY_ASAN_ENABLED
+/* callcc can't possibly work with ASAN; see bug #20273. Also this function
+ * definition below avoids a "defined and not used" warning. */
+MAYBE_UNUSED(static void notusing_callcc(void)) { rb_callcc(Qnil); }
+# define rb_callcc rb_f_notimplement
+#endif
+
static VALUE
make_passing_arg(int argc, const VALUE *argv)