Skip to content

Commit

Permalink
Fix ASAN issue in extractorf when using AVX2
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-steinegger committed Sep 1, 2020
1 parent b15e95a commit 113e321
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/commons/Orf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,15 @@ void Orf::findForward(const char *sequence, const size_t sequenceLength, std::ve

// Offset the start position by reading frame
size_t from[FRAMES] = {frameOffset[0], frameOffset[1], frameOffset[2]};

simd_int startCodonsHi = simdi_load((simd_int*)startCodons);
simd_int startCodonsLo = simdi_loadu((simd_int*)(startCodons + 16));

simd_int stopCodonsHi = simdi_load((simd_int*)stopCodons);
simd_int stopCodonsLo = simdi_loadu((simd_int*)(stopCodons + 16));
simd_int stopCodonsHi = simdi_load((simd_int*)stopCodons);
#ifdef AVX2
simd_int startCodonsLo = simdi_setzero();
simd_int stopCodonsLo = simdi_setzero();
#else
simd_int startCodonsLo = simdi_load((simd_int*)startCodons + 16);
simd_int stopCodonsLo = simdi_load((simd_int*)stopCodons + 16);
#endif
for (size_t i = 0; i < sequenceLength - (FRAMES - 1); i += FRAMES) {
for(size_t position = i; position < i + FRAMES; position++) {
// make everything that is not CHAR_MAX upper case
Expand Down

0 comments on commit 113e321

Please sign in to comment.