From adb2fbf69af9f50aeab4d9f662ec3b127cb1db39 Mon Sep 17 00:00:00 2001 From: Matt Valentine-House Date: Thu, 8 Feb 2024 16:09:07 +0000 Subject: [PATCH] [PRISM] Prism/eval should handle file names provided --- vm_eval.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/vm_eval.c b/vm_eval.c index ecbe790ae2..d5e7dfce67 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -1649,7 +1649,16 @@ pm_eval_make_iseq(VALUE src, VALUE fname, int line, const rb_iseq_t *const parent = vm_block_iseq(base_block); const rb_iseq_t *iseq = parent; VALUE name = rb_fstring_lit(""); - fname = rb_fstring_lit(""); + if (!fname) { + fname = rb_source_location(&line); + } + + if (!UNDEF_P(fname)) { + if (!NIL_P(fname)) fname = rb_fstring(fname); + } + else { + fname = get_eval_default_path(); + } pm_parse_result_t result = { 0 };