summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vm_eval.c b/vm_eval.c
index 5cb72934b8..22b3e1eabd 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1215,7 +1215,7 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *const cref_arg,
absolute_path = file;
}
- if (scope != Qnil) {
+ if (!NIL_P(scope)) {
bind = Check_TypedStruct(scope, &ruby_binding_data_type);
{
envval = bind->env;
@@ -1265,6 +1265,7 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *const cref_arg,
COPY_CREF(cref, orig_cref);
}
vm_set_eval_stack(th, iseqval, cref, base_block);
+ th->cfp->klass = CLASS_OF(base_block->self);
RB_GC_GUARD(crefval);
if (0) { /* for debug */