summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/vm_method.c b/vm_method.c
index 672fac0462..c5ca644230 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -670,8 +670,13 @@ 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)
{
- rb_method_iseq_t iseq_body = {(rb_iseq_t *)iseq, cref};
+ struct { /* should be same fields with rb_method_iseq_struct */
+ const rb_iseq_t *iseqptr;
+ rb_cref_t *cref;
+ } iseq_body;
+ iseq_body.iseqptr = iseq;
+ iseq_body.cref = cref;
rb_add_method(klass, mid, VM_METHOD_TYPE_ISEQ, &iseq_body, visi);
}