Commit 683ff0cb authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #3106 from mame/fix-eval-no-filename

Fix segfault when `eval("__FILE__")` is executed
parents 74d52a11 668cc1b4
......@@ -147,9 +147,11 @@ create_proc_from_string(mrb_state *mrb, char *s, int len, mrb_value binding, cha
cxt = mrbc_context_new(mrb);
cxt->lineno = line;
if (file) {
mrbc_filename(mrb, cxt, file);
if (!file) {
file = "(eval)";
}
mrbc_filename(mrb, cxt, file);
cxt->capture_errors = TRUE;
cxt->no_optimize = TRUE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment