mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge branch 'master' of github.com:mruby/mruby
This commit is contained in:
@@ -522,6 +522,7 @@ mrb_mod_include(mrb_state *mrb, mrb_value klass)
|
||||
mrb_value mod;
|
||||
|
||||
mrb_get_args(mrb, "o", &mod);
|
||||
mrb_check_type(mrb, mod, MRB_TT_MODULE);
|
||||
mrb_include_module(mrb, mrb_class_ptr(klass), mrb_class_ptr(mod));
|
||||
return mod;
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ localjump_error(mrb_state *mrb, const char *kind)
|
||||
mrb_value exc;
|
||||
|
||||
snprintf(buf, 256, "unexpected %s", kind);
|
||||
exc = mrb_exc_new(mrb, E_LOCALJUMP_ERROR, buf, sizeof(buf));
|
||||
exc = mrb_exc_new(mrb, E_LOCALJUMP_ERROR, buf, strlen(buf));
|
||||
mrb->exc = mrb_object(exc);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user