summaryrefslogtreecommitdiff
path: root/ext/dl/lib/dl
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-21 06:53:40 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-21 06:53:40 +0000
commit3401fc59849c789df3893e514939f63ad0f2f26e (patch)
tree43e65edb8911c09c60bb177ee1785eb996320745 /ext/dl/lib/dl
parent68c09dec0ec57a7e620d42aceac2fdf8a952d53d (diff)
* ext/dl/lib/dl/func.rb (DL::Function#bind): fixes an error in
test/dl/test_import.rb (DL::TestImport#test_carried_function) introduced by r36718. the instance of the anonymous class which wraps the block should have same methods and instance variables of self. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/lib/dl')
-rw-r--r--ext/dl/lib/dl/func.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/dl/lib/dl/func.rb b/ext/dl/lib/dl/func.rb
index c80cf8a9e1f..c5d569575c0 100644
--- a/ext/dl/lib/dl/func.rb
+++ b/ext/dl/lib/dl/func.rb
@@ -91,7 +91,7 @@ module DL
raise(RuntimeError, "block must be given.")
end
unless block.lambda?
- block = Class.new{define_method(:call, block)}.new.method(:call)
+ block = Class.new(self.class){define_method(:call, block); def initialize(obj); obj.instance_variables.each{|s| instance_variable_set(s, obj.instance_variable_get(s))}; end}.new(self).method(:call)
end
if( @cfunc.ptr == 0 )
cb = Proc.new{|*args|