Skip to content

Commit

Permalink
Fix segfault due to memcpy (#155)
Browse files Browse the repository at this point in the history
Fixes failing tests on Linux and OSX
  • Loading branch information
blegat authored and musm committed Jan 4, 2019
1 parent 9c67743 commit bfdb84b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mxarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ function _copy_sparse_mat(a::SparseMatrixCSC{V,I}, ir_p::Ptr{mwIndex}, jc_p::Ptr
jc[i] = colptr[i] - 1
end

ccall(:memcpy, Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cvoid}, UInt), pr_p, v, nnz*sizeof(V))
copyto!(unsafe_wrap(Array, pr_p, (nnz,)), v)
end

function mxarray(a::SparseMatrixCSC{V,I}) where {V<:Union{Float64,Bool},I}
Expand Down

0 comments on commit bfdb84b

Please sign in to comment.