Skip to content

Commit

Permalink
add NO_SANITIZE_ATTR to Adaptor.hh.in
Browse files Browse the repository at this point in the history
  • Loading branch information
luffy-zh committed Feb 6, 2025
1 parent 003f4f2 commit 07bd591
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions c++/src/Adaptor.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ typedef SSIZE_T ssize_t;
ssize_t pread(int fd, void* buf, size_t count, off_t offset);
#endif

#if defined(__GNUC__) || defined(__clang__)
#define NO_SANITIZE_ATTR __attribute__((no_sanitize("signed-integer-overflow", "shift")))
#else
#define NO_SANITIZE_ATTR
#endif

#ifdef HAS_DIAGNOSTIC_PUSH
#ifdef __clang__
#define DIAGNOSTIC_PUSH _Pragma("clang diagnostic push")
Expand Down
2 changes: 1 addition & 1 deletion c++/src/BloomFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ namespace orc {
}
}

__attribute__((no_sanitize("signed-integer-overflow","shift")))
NO_SANITIZE_ATTR
bool BloomFilterImpl::testHash(int64_t hash64) const {
int32_t hash1 = static_cast<int32_t>(hash64 & 0xffffffff);
// In Java codes, we use "hash64 >>> 32" which is an unsigned shift op.
Expand Down
1 change: 1 addition & 0 deletions c++/src/BloomFilter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#ifndef ORC_BLOOMFILTER_IMPL_HH
#define ORC_BLOOMFILTER_IMPL_HH

#include "Adaptor.hh"
#include "orc/BloomFilter.hh"
#include "wrap/orc-proto-wrapper.hh"

Expand Down
1 change: 1 addition & 0 deletions c++/src/RLE.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#ifndef ORC_RLE_HH
#define ORC_RLE_HH

#include "Adaptor.hh"
#include "io/InputStream.hh"
#include "io/OutputStream.hh"

Expand Down

0 comments on commit 07bd591

Please sign in to comment.