From 97628bff1211a6bc7bac53e75d0ceef64db3bc60 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 16 Dec 2014 05:54:32 +0000 Subject: 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 --- iseq.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'iseq.c') diff --git a/iseq.c b/iseq.c index 7e1ac877c1..f1b38240a8 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)); -- cgit v1.2.3