add new function mrb_toplevel_run to prevent running through C function boudaries on exceptions; close #1942

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-03-26 01:09:09 +09:00
parent b042b951ce
commit bfd2a539ed
4 changed files with 21 additions and 3 deletions
+1 -1
View File
@@ -5506,7 +5506,7 @@ load_exec(mrb_state *mrb, parser_state *p, mrbc_context *c)
if (mrb->c->ci) {
mrb->c->ci->target_class = target;
}
v = mrb_context_run(mrb, proc, mrb_top_self(mrb), 0);
v = mrb_toplevel_run(mrb, proc);
if (mrb->exc) return mrb_nil_value();
return v;
}