fix ubsan final

This commit is contained in:
Nikita Mikhaylov 2020-07-06 12:29:22 +03:00
parent 5c97106ea3
commit dac7a39256
2 changed files with 5 additions and 4 deletions

View File

@ -86,7 +86,10 @@ static INLINE void memcpy_sse2_128(void *dst, const void *src) {
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// tiny memory copy with jump table optimized // tiny memory copy with jump table optimized
//--------------------------------------------------------------------- //---------------------------------------------------------------------
static INLINE void *memcpy_tiny(void *dst, const void *src, size_t size) { /// Attribute is used to avoid an error with undefined behaviour sanitizer
/// ../contrib/FastMemcpy/FastMemcpy.h:91:56: runtime error: applying zero offset to null pointer
/// Found by 01307_orc_output_format.sh, cause - ORCBlockInputFormat and external ORC library.
__attribute__((__no_sanitize__("undefined"))) static INLINE void *memcpy_tiny(void *dst, const void *src, size_t size) {
unsigned char *dd = ((unsigned char*)dst) + size; unsigned char *dd = ((unsigned char*)dst) + size;
const unsigned char *ss = ((const unsigned char*)src) + size; const unsigned char *ss = ((const unsigned char*)src) + size;

View File

@ -23,9 +23,7 @@ ORCBlockInputFormat::ORCBlockInputFormat(ReadBuffer & in_, Block header_) : IInp
{ {
} }
/// Attribute is used to avoid an error with undefined behaviour sanitizer Chunk ORCBlockInputFormat::generate()
/// ../contrib/FastMemcpy/FastMemcpy.h:91:56: runtime error: applying zero offset to null pointer
__attribute__((__no_sanitize__("undefined"))) Chunk ORCBlockInputFormat::generate()
{ {
Chunk res; Chunk res;
const Block & header = getPort().getHeader(); const Block & header = getPort().getHeader();