1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2014-12-16 01:14:20 +00:00
parent 9aeb74d0de
commit 389ea73014
2 changed files with 4 additions and 0 deletions

View file

@ -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:

3
iseq.c
View file

@ -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));
}