Skip to content

Conversation

@stevengj
Copy link
Member

@stevengj stevengj commented Feb 11, 2025

#55906 changed cconvert(Ref{BigFloat}, x::BigFloat) to return x.d, but neglected to do so for other types of x, where it still returns a Ref{BigFloat} and hence is now returning the wrong type for ccall.

Not only does this break backwards compatibility (JuliaMath/SpecialFunctions.jl#485), but it also seems simply wrong: the whole job of cconvert is to convert objects to the correct type for use with ccall. This PR does so (at least for Number and Ref{BigFloat}).

@KristofferC KristofferC added the backport 1.12 Change should be backported to release-1.12 label Feb 11, 2025
@KristofferC KristofferC merged commit 6dca4f4 into master Feb 12, 2025
12 checks passed
@KristofferC KristofferC deleted the ccall_ref_bigfloat branch February 12, 2025 12:12
KristofferC pushed a commit that referenced this pull request Feb 13, 2025
#55906 changed `cconvert(Ref{BigFloat}, x::BigFloat)` to return `x.d`,
but neglected to do so for other types of `x`, where it still returns a
`Ref{BigFloat}` and hence is now returning the wrong type for `ccall`.

Not only does this break backwards compatibility
(JuliaMath/SpecialFunctions.jl#485), but it
also seems simply wrong: the *whole* job of `cconvert` is to convert
objects to the correct type for use with `ccall`. This PR does so (at
least for `Number` and `Ref{BigFloat}`).

(cherry picked from commit 6dca4f4)
@KristofferC KristofferC removed the backport 1.12 Change should be backported to release-1.12 label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bignums BigInt and BigFloat bugfix This change fixes an existing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants