JuliaInterop / libcxxwrap-julia

C++ library for backing CxxWrap.jl
Other
85 stars 43 forks source link

Array: use jl_array_ptr_set to avoid failed assertion on nightly #139

Closed benlorenz closed 10 months ago

benlorenz commented 11 months ago

My fix from #137 unfortunately triggers an assertion in PkgEval (i.e. nightly built with assertions enabled):

Failed to precompile CxxWrap [1f15a43c-97ca-5a2a-ae31-89f07a497df4] to "/home/pkgeval/.julia/compiled/v1.11/CxxWrap/jl_g65kMF".
julia: /source/src/array.c:277: ijl_array_ptr_1d_push: Assertion `(((((jl_taggedvalue_t*)((char*)(a) - sizeof(jl_taggedvalue_t)))->header) & ~(uintptr_t)15)==(uintptr_t)(jl_array_any_type))' failed.

(The code does seem to work fine without assertions)

Switching to jl_array_ptr_set avoids that error and should also work across all supported julia versions.

barche commented 10 months ago

Thanks!