Browse files

Merge pull request #96 from k-tsj/fix-return-segv

Fix SEGV when returning from terminated method
  • Loading branch information...
2 parents f255d33 + 7e1df10 commit 91a90540737ddc233d0c68dea05d779fafc32e8e @matz matz committed May 4, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/vm.c
View
1 src/vm.c
@@ -992,6 +992,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
case OP_R_RETURN:
if (proc->env->cioff < 0) {
localjump_error(mrb, "return");
+ goto L_RAISE;
}
ci = mrb->ci = mrb->cibase + proc->env->cioff;
break;

0 comments on commit 91a9054

Please sign in to comment.