diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/src/ctypes/CTypes.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/js/src/ctypes/CTypes.cpp b/js/src/ctypes/CTypes.cpp index b75b42072f..3bc249e015 100644 --- a/js/src/ctypes/CTypes.cpp +++ b/js/src/ctypes/CTypes.cpp @@ -6708,12 +6708,15 @@ PrepareCIF(JSContext* cx, if (!rtype) return false; - ffi_status status = - ffi_prep_cif(&fninfo->mCIF, - abi, - fninfo->mFFITypes.length(), - rtype, - fninfo->mFFITypes.begin()); + ffi_status status; + if (fninfo->mIsVariadic) { + status = ffi_prep_cif_var(&fninfo->mCIF, abi, fninfo->mArgTypes.length(), + fninfo->mFFITypes.length(), rtype, + fninfo->mFFITypes.begin()); + } else { + status = ffi_prep_cif(&fninfo->mCIF, abi, fninfo->mFFITypes.length(), rtype, + fninfo->mFFITypes.begin()); + } switch (status) { case FFI_OK: |