Skip to content

Commit

Permalink
fix memory corruption in deleteat! (#41646)
Browse files Browse the repository at this point in the history
n.b. `n == a->nrows + dec`

Fixes JuliaData/DataFrames.jl#2819

(cherry picked from commit 2e06a01)
  • Loading branch information
vtjnash authored and KristofferC committed Jul 26, 2021
1 parent 8d49537 commit c770312
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ STATIC_INLINE void jl_array_del_at_beg(jl_array_t *a, size_t idx, size_t dec,
// Move the rest of the data if the offset changed
if (newoffs != offset) {
memmove_safe(a->flags.hasptr, newdata + nb1, olddata + nb1 + nbdec, nbtotal - nb1);
if (isbitsunion) memmove(newtypetagdata + idx, typetagdata + idx + dec, n - idx);
if (isbitsunion) memmove(newtypetagdata + idx, typetagdata + idx + dec, a->nrows - idx);
}
a->data = newdata;
}
Expand Down

0 comments on commit c770312

Please sign in to comment.