summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--ext/dl/lib/dl/func.rb2
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f165de847c..03d946ef54 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Tue Aug 21 15:44:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * 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.
+
Tue Aug 21 14:29:22 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/Makefile.sub (scriptbin.mk): no need to include twice.
diff --git a/ext/dl/lib/dl/func.rb b/ext/dl/lib/dl/func.rb
index c80cf8a9e1..c5d569575c 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|