Skip to content

Commit

Permalink
kernel: replace memmove in FuncSCR_SIFT_HELPER by memcpy
Browse files Browse the repository at this point in the history
Moving data from an existing perm to a freshly created one cannot overlap
  • Loading branch information
fingolfin committed Jan 4, 2018
1 parent 3fbe545 commit 2764eba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/permutat.c
Original file line number Diff line number Diff line change
Expand Up @@ -4443,12 +4443,12 @@ Obj FuncSCR_SIFT_HELPER(Obj self, Obj S, Obj g, Obj n)
/* Copy g into the buffer */
if (IS_PERM2(g) && useP2) {
UInt2 * ptR = ADDR_PERM2(result);
memmove(ptR, CONST_ADDR_PERM2(g),2*dg);
memcpy(ptR, CONST_ADDR_PERM2(g), 2*dg);
for ( i = dg; i < nn; i++)
ptR[i] = (UInt2)i;
} else if (IS_PERM4(g) && !useP2) {
UInt4 *ptR = ADDR_PERM4(result);
memmove(ptR,CONST_ADDR_PERM4(g),4*dg);
memcpy(ptR, CONST_ADDR_PERM4(g), 4*dg);
for ( i = dg; i <nn; i++)
ptR[i] = (UInt4)i;
} else if (IS_PERM2(g) && !useP2) {
Expand Down

0 comments on commit 2764eba

Please sign in to comment.