Skip to content

Commit 86436d4

Browse files
committed
Fix issue when calling _core_groebner_basis_array from Oscar
1 parent 2171d26 commit 86436d4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/algorithms/groebner-bases.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,16 +210,16 @@ function _core_groebner_basis_array(
210210

211211
# convert to julia array, also give memory management to julia
212212
jl_ld = gb_ld[]
213-
jl_len = Int32.(Base.unsafe_wrap(Array, gb_len[], jl_ld))
214-
jl_exp = Int32.(Base.unsafe_wrap(Array, gb_exp[], nr_terms * nr_vars))
213+
jl_len = Int32[deepcopy(unsafe_load(gb_len[], i)) for i in 1:jl_ld]
214+
jl_exp = Int32[deepcopy(unsafe_load(gb_exp[], i)) for i in 1:(nr_terms * nr_vars)]
215215

216216
# coefficient handling depending on field characteristic
217217
if field_char == 0
218218
ptr = reinterpret(Ptr{BigInt}, gb_cf[])
219-
jl_cf = BigInt.([deepcopy(unsafe_load(ptr, i)) for i in 1:nr_terms])
219+
jl_cf = BigInt[deepcopy(unsafe_load(ptr, i)) for i in 1:nr_terms]
220220
else
221221
ptr = reinterpret(Ptr{Int32}, gb_cf[])
222-
jl_cf = Int32.(Base.unsafe_wrap(Array, ptr, nr_terms))
222+
jl_cf = Int32[deepcopy(unsafe_load(ptr, i)) for i in 1:nr_terms]
223223
end
224224

225225
ccall((:free_f4_julia_result_data, libneogb), Nothing,

0 commit comments

Comments
 (0)