mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #3106 from mame/fix-eval-no-filename
Fix segfault when `eval("__FILE__")` is executed
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user