summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--ext/dl/lib/dl/func.rb3
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 8ff7891da2..131849e912 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Aug 17 12:39:33 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/dl/lib/dl/func.rb (DL::Function#bind): allow to return/break from
+ the callback method. (Fiddle already allows it.)
+ [Bug #6389] [ruby-dev:45604]
+
Thu Aug 16 19:54:24 2012 Koichi Sasada <ko1@atdot.net>
* vm_trace.c, vm_core.h: simplify tracing mechanism.
diff --git a/ext/dl/lib/dl/func.rb b/ext/dl/lib/dl/func.rb
index 3c2245f413..c80cf8a9e1 100644
--- a/ext/dl/lib/dl/func.rb
+++ b/ext/dl/lib/dl/func.rb
@@ -90,6 +90,9 @@ module DL
if( !block )
raise(RuntimeError, "block must be given.")
end
+ unless block.lambda?
+ block = Class.new{define_method(:call, block)}.new.method(:call)
+ end
if( @cfunc.ptr == 0 )
cb = Proc.new{|*args|
ary = @stack.unpack(args)