From 33721b4d3306b68188ea253eb0cd717dfa71f917 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 10 Apr 2019 06:44:42 +0000 Subject: [PATCH] vm_method.c: fix a warning * vm_method.c (rb_add_method_iseq): use rb_method_iseq_t, as rb_method_definition_set refers, with a cast to suppress a warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_method.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/vm_method.c b/vm_method.c index 96a2656f87..672fac0462 100644 --- a/vm_method.c +++ b/vm_method.c @@ -670,13 +670,8 @@ rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *opts, rb_method_ MJIT_FUNC_EXPORTED void rb_add_method_iseq(VALUE klass, ID mid, const rb_iseq_t *iseq, rb_cref_t *cref, rb_method_visibility_t visi) { - struct { /* should be same fields with rb_method_iseq_struct */ - rb_iseq_t *iseqptr; - rb_cref_t *cref; - } iseq_body; + rb_method_iseq_t iseq_body = {(rb_iseq_t *)iseq, cref}; - iseq_body.iseqptr = iseq; - iseq_body.cref = cref; rb_add_method(klass, mid, VM_METHOD_TYPE_ISEQ, &iseq_body, visi); }