summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-17 04:13:38 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-17 04:13:38 +0000
commit6d886eb2557fe846957da483ab08f7c964e95679 (patch)
tree9ac5968fc1c472288c59a77c27390509333819de /vm_eval.c
parent7e344b0b7b877fcf203ab29f56e417993fb4cb11 (diff)
merge revision(s) 47645: [Backport #10263]
* vm_eval.c (eval_string_with_cref): fix super from eval with scope. set klass in the current control frame to the class of the receiver in the context to be evaluated, this class/module must match the actual receiver to call super. [ruby-core:65122] [Bug #10263] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@47987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 dff323f105..13030377be 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1187,7 +1187,7 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, volatile V
absolute_path = file;
}
- if (scope != Qnil) {
+ if (!NIL_P(scope)) {
if (rb_obj_is_kind_of(scope, rb_cBinding)) {
GetBindingPtr(scope, bind);
envval = bind->env;
@@ -1231,6 +1231,7 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, volatile V
th->parse_in_eval--;
vm_set_eval_stack(th, iseqval, cref, base_block);
+ th->cfp->klass = CLASS_OF(base_block->self);
if (0) { /* for debug */
VALUE disasm = rb_iseq_disasm(iseqval);