aboutsummaryrefslogtreecommitdiffstats
path: root/vm_eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/vm_eval.c b/vm_eval.c
index fefe6d6dfd..9806762d96 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -963,6 +963,10 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char
if (rb_obj_is_kind_of(scope, rb_cBinding)) {
GetBindingPtr(scope, bind);
envval = bind->env;
+ if (strcmp(file, "(eval)") == 0) {
+ file = RSTRING_PTR(bind->filename);
+ line = bind->line_no;
+ }
}
else {
rb_raise(rb_eTypeError,