Skip to content

Commit

Permalink
type pun rb_f_notimplement
Browse files Browse the repository at this point in the history
Other functions are already type-punned elsewhere.  rb_f_notimplement is
the only exceptional function that appear literally.  We have to take
care of it by hand.
  • Loading branch information
shyouhei committed Sep 21, 2022
1 parent 4e64edb commit ec5798d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vm_method.c
Expand Up @@ -372,7 +372,7 @@ void
rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_visibility_t visi)
{
if (argc < -2 || 15 < argc) rb_raise(rb_eArgError, "arity out of range: %d for -2..15", argc);
if (func != rb_f_notimplement) {
if (func != (VALUE(*)(ANYARGS))rb_f_notimplement) {
rb_method_cfunc_t opt;
opt.func = func;
opt.argc = argc;
Expand Down Expand Up @@ -561,7 +561,7 @@ rb_method_definition_set(const rb_method_entry_t *me, rb_method_definition_t *de
RB_OBJ_WRITE(me, &def->body.bmethod.defined_ractor, rb_ractor_self(GET_RACTOR()));
return;
case VM_METHOD_TYPE_NOTIMPLEMENTED:
setup_method_cfunc_struct(UNALIGNED_MEMBER_PTR(def, body.cfunc), rb_f_notimplement_internal, -1);
setup_method_cfunc_struct(UNALIGNED_MEMBER_PTR(def, body.cfunc), (VALUE(*)(ANYARGS))rb_f_notimplement_internal, -1);
return;
case VM_METHOD_TYPE_OPTIMIZED:
def->body.optimized = *(rb_method_optimized_t *)opts;
Expand Down

0 comments on commit ec5798d

Please sign in to comment.