Skip to content

Commit 116ca11

Browse files
vtjnashKristofferC
authored andcommitted
fix memory corruption in deleteat! (#41646)
n.b. `n == a->nrows + dec` Fixes JuliaData/DataFrames.jl#2819 (cherry picked from commit 2e06a01)
1 parent f6804d6 commit 116ca11

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
@@ -1095,7 +1095,7 @@ STATIC_INLINE void jl_array_del_at_beg(jl_array_t *a, size_t idx, size_t dec,
10951095
// Move the rest of the data if the offset changed
10961096
if (newoffs != offset) {
10971097
memmove_safe(a->flags.hasptr, newdata + nb1, olddata + nb1 + nbdec, nbtotal - nb1);
1098-
if (isbitsunion) memmove(newtypetagdata + idx, typetagdata + idx + dec, n - idx);
1098+
if (isbitsunion) memmove(newtypetagdata + idx, typetagdata + idx + dec, a->nrows - idx);
10991099
}
11001100
a->data = newdata;
11011101
}

0 commit comments

Comments
 (0)