aboutsummaryrefslogtreecommitdiffstats
path: root/ext/-test-/symbol/intern.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/-test-/symbol/intern.c')
-rw-r--r--ext/-test-/symbol/intern.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ext/-test-/symbol/intern.c b/ext/-test-/symbol/intern.c
new file mode 100644
index 0000000000..6ae86a6104
--- /dev/null
+++ b/ext/-test-/symbol/intern.c
@@ -0,0 +1,14 @@
+#include "ruby.h"
+
+static VALUE
+bug_sym_interned_p(VALUE self, VALUE name)
+{
+ ID id = rb_check_id(&name);
+ return id ? Qtrue : Qfalse;
+}
+
+void
+Init_intern(VALUE klass)
+{
+ rb_define_singleton_method(klass, "interned?", bug_sym_interned_p, 1);
+}