diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-06-20 15:12:35 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-06-20 15:12:35 +0900 |
| commit | 88db589e7f965e5b16b82eca76f2e1febd82d124 (patch) | |
| tree | 7fbb6cd7f88440bb887131a88372dd445021e587 | |
| parent | 97e5ab22f66d0b70643ac2b6d76aef55a5122746 (diff) | |
| download | mruby-88db589e7f965e5b16b82eca76f2e1febd82d124.tar.gz mruby-88db589e7f965e5b16b82eca76f2e1febd82d124.zip | |
protect crash from empty irep
| -rw-r--r-- | src/vm.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -788,6 +788,10 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) /* setup environment for calling method */ proc = m; irep = m->body.irep; + if (!irep) { + mrb->stack[0] = mrb_nil_value(); + goto L_RETURN; + } pool = irep->pool; syms = irep->syms; ci->nregs = irep->nregs; |
