summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-16 11:03:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-16 11:03:38 +0000
commit6c7fd3b5cf97ad1a19f9f82e3c7c61f3422778c8 ()
tree05cf79a222cab2b30c9aa181b71bae4c5fa6f5cd
parent50591a768de9e2381789a8aeed1bc2c654c18e83 (diff)
proc.c: fail symbol proc binding
* proc.c (proc_binding): proc from symbol can not make a binding. [ruby-core:74100] [Bug #12137] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--proc.c2
-rw-r--r--test/ruby/test_symbol.rb9
3 files changed, 16 insertions, 0 deletions
@@ -1,3 +1,8 @@
Wed Mar 16 18:42:45 2016 Martin Duerst <[email protected]>
* test/ruby/enc/test_case_mapping.rb: Fixed and activated a test for Cherokee.
@@ -2658,6 +2658,7 @@ proc_binding(VALUE self)
GetProcPtr(self, proc);
envval = rb_vm_proc_envval(proc);
iseq = proc->block.iseq;
if (RUBY_VM_IFUNC_P(iseq)) {
struct vm_ifunc *ifunc = (struct vm_ifunc *)iseq;
if (IS_METHOD_PROC_IFUNC(ifunc)) {
@@ -2666,6 +2667,7 @@ proc_binding(VALUE self)
iseq = rb_method_iseq(method);
}
else {
rb_raise(rb_eArgError, "Can't create Binding from C level Proc");
}
}
@@ -176,6 +176,15 @@ class TestSymbol < Test::Unit::TestCase
end;
end
def test_call
o = Object.new
def o.foo(x, y); x + y; end