diff options
author | Wayne Meissner <wmeissner@gmail.com> | 2012-11-13 07:43:01 +1100 |
---|---|---|
committer | Wayne Meissner <wmeissner@gmail.com> | 2012-11-13 07:43:01 +1100 |
commit | 6be4b133465f12c69420b5c0b334da4f1149f969 (patch) | |
tree | 4ca48ffddc46d4ecd988c1895a6252d8555f6d63 | |
parent | 1f6f25f314f4e6797336d6ff750e52209a7016fa (diff) | |
download | ffi-6be4b133465f12c69420b5c0b334da4f1149f969.tar.gz |
Fix FFI.attach_function to not rewrite the passed in arg_types array in-place
-rw-r--r-- | lib/ffi/library.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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, |