Skip to content

Commit

Permalink
Fix vec_zero_copy when src == dst
Browse files Browse the repository at this point in the history
Fixes 3 / 2 returning 0 in node #90
  • Loading branch information
tbodt committed Jun 26, 2020
1 parent 25a77a8 commit 65aca71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion emu/vec.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ static inline void zero_xmm(union xmm_reg *xmm) {

#define VEC_ZERO_COPY(zero, copy) \
void vec_zero##zero##_copy##copy(NO_CPU, const void *src, void *dst) { \
memset(dst, 0, zero/8); \
memcpy(dst, src, copy/8); \
memset((char *) dst + copy/8, 0, (zero-copy)/8); \
}
VEC_ZERO_COPY(128, 128)
VEC_ZERO_COPY(128, 64)
Expand Down
6 changes: 6 additions & 0 deletions emu/vec_noasan.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <math.h>
#include <string.h>

#include "emu/vec.h"
#include "emu/cpu.h"

0 comments on commit 65aca71

Please sign in to comment.