From 6be4b133465f12c69420b5c0b334da4f1149f969 Mon Sep 17 00:00:00 2001 From: Wayne Meissner Date: Tue, 13 Nov 2012 07:43:01 +1100 Subject: Fix FFI.attach_function to not rewrite the passed in arg_types array in-place --- lib/ffi/library.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ffi/library.rb b/lib/ffi/library.rb index 3aa781f..20edab1 100644 --- a/lib/ffi/library.rb +++ b/lib/ffi/library.rb @@ -212,7 +212,7 @@ module FFI cname, arg_types, ret_type, opts = (a4 && (a2.is_a?(String) || a2.is_a?(Symbol))) ? [ a2, a3, a4, a5 ] : [ mname.to_s, a2, a3, a4 ] # Convert :foo to the native type - arg_types.map! { |e| find_type(e) } + arg_types = arg_types.map { |e| find_type(e) } options = { :convention => ffi_convention, :type_map => defined?(@ffi_typedefs) ? @ffi_typedefs : nil, -- cgit v1.2.1