diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-07-23 02:08:37 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-07-23 02:08:37 +0900 |
| commit | 1b5584b3c8e3ace7941ec7363156c0ad139cf4c5 (patch) | |
| tree | 490a1396e48725da2cd02e557dfb8226a90c236f | |
| parent | 6d742ef93aaa2cb6fe682f05c7e04cfb9be11353 (diff) | |
| download | mruby-1b5584b3c8e3ace7941ec7363156c0ad139cf4c5.tar.gz mruby-1b5584b3c8e3ace7941ec7363156c0ad139cf4c5.zip | |
check if block is given in eval_under(); fix #2486
| -rw-r--r-- | src/vm.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -484,6 +484,9 @@ eval_under(mrb_state *mrb, mrb_value self, mrb_value blk, struct RClass *c) struct RProc *p; mrb_callinfo *ci; + if (mrb_nil_p(blk)) { + mrb_raise(mrb, E_ARGUMENT_ERROR, "no block given"); + } ci = mrb->c->ci; if (ci->acc == CI_ACC_DIRECT) { return mrb_yield_with_class(mrb, blk, 0, 0, self, c); |
