summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-06-20 15:12:35 +0900
committerYukihiro Matsumoto <[email protected]>2012-06-20 15:12:35 +0900
commit88db589e7f965e5b16b82eca76f2e1febd82d124 (patch)
tree7fbb6cd7f88440bb887131a88372dd445021e587 /src
parent97e5ab22f66d0b70643ac2b6d76aef55a5122746 (diff)
downloadmruby-88db589e7f965e5b16b82eca76f2e1febd82d124.tar.gz
mruby-88db589e7f965e5b16b82eca76f2e1febd82d124.zip
protect crash from empty irep
Diffstat (limited to 'src')
-rw-r--r--src/vm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vm.c b/src/vm.c
index 826cdafef..c78799c6d 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -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;