From 389ea73014d8e7ed67ca289679d4aa50a375a5ef Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 16 Dec 2014 01:14:20 +0000 Subject: compile.c: check funcptr * compile.c (iseq_build_from_ary_body): cannot load dumped funcptr. * iseq.c (iseq_data_to_ary): cannot dump funcptr. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- compile.c | 1 + iseq.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/compile.c b/compile.c index 9230935819..a6ce631513 100644 --- a/compile.c +++ b/compile.c @@ -5950,6 +5950,7 @@ 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; break; default: diff --git a/iseq.c b/iseq.c index de304906fe..297299e00a 100644 --- a/iseq.c +++ b/iseq.c @@ -1973,6 +1973,9 @@ iseq_data_to_ary(rb_iseq_t *iseq) rb_ary_push(ary, val); } break; + case TS_FUNCPTR: + rb_ary_push(ary, Qnil); + break; default: rb_bug("unknown operand: %c", insn_op_type(insn, j)); } -- cgit v1.2.3