summaryrefslogtreecommitdiffhomepage
path: root/src/load.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-03-26 01:09:09 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-03-26 01:09:09 +0900
commitbfd2a539edab8ef7935a75de8a6885d74ff9e8ef (patch)
treefce8fd6d21b944d892fc9a9e718f6afd16a79a7d /src/load.c
parentb042b951ce4003f00dc33cdac1c9d422e1a21d55 (diff)
downloadmruby-bfd2a539edab8ef7935a75de8a6885d74ff9e8ef.tar.gz
mruby-bfd2a539edab8ef7935a75de8a6885d74ff9e8ef.zip
add new function mrb_toplevel_run to prevent running through C function boudaries on exceptions; close #1942
Diffstat (limited to 'src/load.c')
-rw-r--r--src/load.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/load.c b/src/load.c
index ca78dbf8c..5b093b751 100644
--- a/src/load.c
+++ b/src/load.c
@@ -512,7 +512,7 @@ mrb_load_irep_cxt(mrb_state *mrb, const uint8_t *bin, mrbc_context *c)
proc = mrb_proc_new(mrb, irep);
mrb_irep_decref(mrb, irep);
if (c && c->no_exec) return mrb_obj_value(proc);
- val = mrb_context_run(mrb, proc, mrb_top_self(mrb), 0);
+ val = mrb_toplevel_run(mrb, proc);
return val;
}
@@ -733,7 +733,7 @@ mrb_load_irep_file_cxt(mrb_state *mrb, FILE* fp, mrbc_context *c)
proc = mrb_proc_new(mrb, irep);
mrb_irep_decref(mrb, irep);
if (c && c->no_exec) return mrb_obj_value(proc);
- val = mrb_context_run(mrb, proc, mrb_top_self(mrb), 0);
+ val = mrb_toplevel_run(mrb, proc);
return val;
}