Skip to content

Commit 2e06a01

Browse files
authored
fix memory corruption in deleteat! (#41646)
n.b. `n == a->nrows + dec` Fixes JuliaData/DataFrames.jl#2819
1 parent ed93e30 commit 2e06a01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ STATIC_INLINE void jl_array_del_at_beg(jl_array_t *a, size_t idx, size_t dec,
11191119
// Move the rest of the data if the offset changed
11201120
if (newoffs != offset) {
11211121
memmove_safe(a->flags.hasptr, newdata + nb1, olddata + nb1 + nbdec, nbtotal - nb1);
1122-
if (isbitsunion) memmove(newtypetagdata + idx, typetagdata + idx + dec, n - idx);
1122+
if (isbitsunion) memmove(newtypetagdata + idx, typetagdata + idx + dec, a->nrows - idx);
11231123
}
11241124
a->data = newdata;
11251125
}

0 commit comments

Comments
 (0)