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:
parent
9aeb74d0de
commit
389ea73014
2 changed files with 4 additions and 0 deletions
|
@ -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
3
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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue