diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-06-15 15:16:56 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-06-15 15:16:56 +0900 |
| commit | 47bd44fce1a441919595de9000ced6f871973b70 (patch) | |
| tree | 8855285456f68dfffc6efcb5fc6b026fd396864d | |
| parent | b298e241c82b72a84b6f852e435b0f2f38cfbb42 (diff) | |
| download | mruby-47bd44fce1a441919595de9000ced6f871973b70.tar.gz mruby-47bd44fce1a441919595de9000ced6f871973b70.zip | |
Prevent Fiber#initialize to be called twice; fix #3705
| -rw-r--r-- | mrbgems/mruby-fiber/src/fiber.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mrbgems/mruby-fiber/src/fiber.c b/mrbgems/mruby-fiber/src/fiber.c index 3c3630a61..a0faafe28 100644 --- a/mrbgems/mruby-fiber/src/fiber.c +++ b/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"); } |
