[前][次][番号順一覧][スレッド一覧]

ruby-changes:73649

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Wed, 21 Sep 2022 11:44:36 +0900 (JST)
Subject: [ruby-changes:73649] ec5798d28b (master): type pun rb_f_notimplement

https://git.ruby-lang.org/ruby.git/commit/?id=ec5798d28b

From ec5798d28bca2c214da886e27d8e870c55301563 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Wed, 14 Sep 2022 14:43:31 +0900
Subject: type pun rb_f_notimplement

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.
---
 vm_method.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vm_method.c b/vm_method.c
index fbe62ecd4c..03ab66d580 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -372,7 +372,7 @@ void https://github.com/ruby/ruby/blob/trunk/vm_method.c#L372
 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;
@@ -561,7 +561,7 @@ rb_method_definition_set(const rb_method_entry_t *me, rb_method_definition_t *de https://github.com/ruby/ruby/blob/trunk/vm_method.c#L561
             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;
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]