aboutsummaryrefslogtreecommitdiffstats
path: root/vm_eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vm_eval.c b/vm_eval.c
index 7a8fffedb9..22d60ee819 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -966,7 +966,7 @@ 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) {
+ if (strcmp(file, "(eval)") == 0 && bind->filename != Qnil) {
file = RSTRING_PTR(bind->filename);
line = bind->line_no;
}