mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
should have protected the return value from GC, even when the method is defined in Ruby; close #1263
This commit is contained in:
@@ -384,7 +384,6 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, int argc, mr
|
||||
int ai = mrb_gc_arena_save(mrb);
|
||||
val = p->body.func(mrb, self);
|
||||
mrb_gc_arena_restore(mrb, ai);
|
||||
mrb_gc_protect(mrb, val);
|
||||
mrb->c->stack = mrb->c->stbase + mrb->c->ci->stackidx;
|
||||
cipop(mrb);
|
||||
}
|
||||
@@ -392,6 +391,7 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, int argc, mr
|
||||
val = mrb_run(mrb, p, self);
|
||||
}
|
||||
}
|
||||
mrb_gc_protect(mrb, val);
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user