Package: ruby-ffi / 1.0.11debian-5

0001-Fix-call-to-variadic-functions.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From ef717f8e16e5d20ad376ed99d11780bacacff16f Mon Sep 17 00:00:00 2001
From: Antonio Terceiro <terceiro@softwarelivre.org>
Date: Sat, 4 Aug 2012 16:30:17 -0300
Subject: [PATCH] Fix call to variadic functions

This changes the call to ffi_prep_cif into a call to ffi_prep_cif_var,
which is the improved libffi API for calling variadic functions.

Calling variadic functions with floating point arguments with
ffi_prep_cif currently only breaks in armhf, but could also break on
other architectures where the ABI for variadic functions is different
from what you would expect.

For more information, please check the following message to the libffi
development mailing list:
http://permalink.gmane.org/gmane.comp.lib.ffi.general/277
---
 ext/ffi_c/Variadic.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ext/ffi_c/Variadic.c b/ext/ffi_c/Variadic.c
index ec5caf4..65b4dd6 100644
--- a/ext/ffi_c/Variadic.c
+++ b/ext/ffi_c/Variadic.c
@@ -219,7 +219,7 @@ variadic_invoke(VALUE self, VALUE parameterTypes, VALUE parameterValues)
     if (ffiReturnType == NULL) {
         rb_raise(rb_eArgError, "Invalid return type");
     }
-    ffiStatus = ffi_prep_cif(&cif, invoker->abi, paramCount, ffiReturnType, ffiParamTypes);
+    ffiStatus = ffi_prep_cif_var(&cif, invoker->abi, paramCount, paramCount, ffiReturnType, ffiParamTypes);
     switch (ffiStatus) {
         case FFI_BAD_ABI:
             rb_raise(rb_eArgError, "Invalid ABI specified");
-- 
1.7.10.4