summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index b25edcb8d2..6c6d933223 100644
--- a/compile.c
+++ b/compile.c
@@ -5964,8 +5964,14 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
}
break;
case TS_FUNCPTR:
- if (!RTEST(op)) rb_raise(rb_eArgError, "cannot load funcptr");
- argv[j] = op;
+ {
+#if SIZEOF_VALUE <= SIZEOF_LONG
+ long funcptr = NUM2LONG(op);
+#else
+ LONG_LONG funcptr = NUM2LL(op);
+#endif
+ argv[j] = (VALUE)funcptr;
+ }
break;
default:
rb_raise(rb_eSyntaxError, "unknown operand: %c", insn_op_type((VALUE)insn_id, j));