diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-17 04:13:38 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-17 04:13:38 +0000 |
commit | 6d886eb2557fe846957da483ab08f7c964e95679 (patch) | |
tree | 9ac5968fc1c472288c59a77c27390509333819de /vm_eval.c | |
parent | 7e344b0b7b877fcf203ab29f56e417993fb4cb11 (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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); |