summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
authorMatt Valentine-House <matt@eightbitraptor.com>2024-02-08 16:09:07 +0000
committerKevin Newton <kddnewton@gmail.com>2024-02-13 21:19:12 -0500
commitadb2fbf69af9f50aeab4d9f662ec3b127cb1db39 (patch)
tree8ec1e8643b2d910cf0b8912d32c28eda5929eac0 /vm_eval.c
parentf70a4a03364f03432e35bf22402d6d1c7f2e40af (diff)
[PRISM] Prism/eval should handle file names provided
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c11
1 files changed, 10 insertions, 1 deletions
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("<compiled>");
- fname = rb_fstring_lit("<compiled>");
+ 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 };