summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/vm_method.c b/vm_method.c
index 5ee1773fe2..311a66993a 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -2024,6 +2024,21 @@ rb_mod_modfunc(int argc, VALUE *argv, VALUE module)
return module;
}
+bool
+rb_method_basic_definition_p_with_cc(struct rb_call_data *cd, VALUE klass, ID mid)
+{
+ if (cd->ci.mid != mid) {
+ *cd = (struct rb_call_data) /* reset */ { .ci = { .mid = mid, }, };
+ }
+
+ vm_search_method_fastpath(cd, klass);
+ return cd->cc.me && METHOD_ENTRY_BASIC(cd->cc.me);
+}
+
+#ifdef __GNUC__
+#pragma push_macro("rb_method_basic_definition_p")
+#undef rb_method_basic_definition_p
+#endif
int
rb_method_basic_definition_p(VALUE klass, ID id)
{
@@ -2032,6 +2047,9 @@ rb_method_basic_definition_p(VALUE klass, ID id)
me = rb_method_entry(klass, id);
return (me && METHOD_ENTRY_BASIC(me)) ? TRUE : FALSE;
}
+#ifdef __GNUC__
+#pragma pop_macro("rb_method_basic_definition_p")
+#endif
static VALUE
call_method_entry(rb_execution_context_t *ec, VALUE defined_class, VALUE obj, ID id,