From 9920da55936adc025fb65bc00d2973cf0d952d87 Mon Sep 17 00:00:00 2001 From: ngoto Date: Wed, 5 Dec 2012 13:24:19 +0000 Subject: * ext/dl/lib/dl/func.rb (DL::Function#bind): When Fiddle is used, @ptr should be updated. This fixes SEGV raised in DL::Function#call after calling DL::Function#bind. [Bug #7516] [ruby-dev:46708] * test/dl/test_func.rb (test_bind): test for the above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/dl/lib/dl/func.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ext/dl/lib') diff --git a/ext/dl/lib/dl/func.rb b/ext/dl/lib/dl/func.rb index 12885738c7..69b6ad306e 100644 --- a/ext/dl/lib/dl/func.rb +++ b/ext/dl/lib/dl/func.rb @@ -118,6 +118,8 @@ module DL @block.call(*args) end }.new(@cfunc.ctype, @args, abi, name, block) + @ptr = @cfunc + return nil else if( !block ) raise(RuntimeError, "block must be given.") -- cgit v1.2.3