summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-16 05:54:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-16 05:54:32 +0000
commit97628bff1211a6bc7bac53e75d0ceef64db3bc60 (patch)
treebaeb4899369d7548a7dc3d3aa7243297766bb95a /iseq.c
parentbad77a862ea27d9e9182c68581341e1d65aa5356 (diff)
compile.c: wrap funcptr
* compile.c (iseq_build_from_ary_body): enclose funcptr with Integer as raw pointer cannot appear in an Array. * iseq.c (iseq_data_to_ary): extract funcptr from Integer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/iseq.c b/iseq.c
index 7e1ac87..f1b3824 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1987,7 +1987,14 @@ iseq_data_to_ary(rb_iseq_t *iseq)
}
break;
case TS_FUNCPTR:
- rb_ary_push(ary, Qnil);
+ {
+#if SIZEOF_VALUE <= SIZEOF_LONG
+ VALUE val = LONG2NUM((SIGNED_VALUE)*seq);
+#else
+ VALUE val = LL2NUM((SIGNED_VALUE)*seq);
+#endif
+ rb_ary_push(ary, val);
+ }
break;
default:
rb_bug("unknown operand: %c", insn_op_type(insn, j));