summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/iseq.c b/iseq.c
index 2647dd1521..da0652092f 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1372,6 +1372,7 @@ rb_iseq_build_for_ruby2cext(
const char *name,
const char *filename)
{
+ int i;
VALUE iseqval = iseq_alloc(rb_cISeq);
rb_iseq_t *iseq;
GetISeqPtr(iseqval, iseq);
@@ -1382,6 +1383,15 @@ rb_iseq_build_for_ruby2cext(
iseq->filename = rb_str_new2(filename);
iseq->mark_ary = rb_ary_new();
+ iseq->iseq = ALLOC_N(VALUE, iseq->iseq_size);
+
+ for (i=0; i<iseq->iseq_size; i+=2) {
+ iseq->iseq[i] = BIN(opt_call_c_function);
+ iseq->iseq[i+1] = (VALUE)func;
+ }
+
+ iseq_translate_threaded_code(iseq);
+
#define ALLOC_AND_COPY(dst, src, type, size) do { \
if (size) { \
(dst) = ALLOC_N(type, (size)); \