Permalink
Browse files

Prevent Fiber#initialize to be called twice; fix #3705

  • Loading branch information...
matz committed Jun 15, 2017
1 parent b298e24 commit 47bd44fce1a441919595de9000ced6f871973b70
Showing with 3 additions and 0 deletions.
  1. +3 −0 mrbgems/mruby-fiber/src/fiber.c
@@ -74,6 +74,9 @@ fiber_init(mrb_state *mrb, mrb_value self)
mrb_get_args(mrb, "&", &blk);
if (f->cxt) {
mrb_raise(mrb, E_RUNTIME_ERROR, "cannot initialize twice");
}
if (mrb_nil_p(blk)) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "tried to create Fiber object without a block");
}

0 comments on commit 47bd44f

Please sign in to comment.