mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Fixed ubsan report in fuzz test
This commit is contained in:
parent
a8d8eb6b28
commit
f748efbb5b
@ -1,5 +1,7 @@
|
|||||||
#include <Functions/FunctionFactory.h>
|
#include <Functions/FunctionFactory.h>
|
||||||
#include <Functions/FunctionBinaryArithmetic.h>
|
#include <Functions/FunctionBinaryArithmetic.h>
|
||||||
|
#include <Core/Defines.h>
|
||||||
|
|
||||||
|
|
||||||
namespace DB
|
namespace DB
|
||||||
{
|
{
|
||||||
@ -10,7 +12,7 @@ struct BitTestImpl
|
|||||||
using ResultType = UInt8;
|
using ResultType = UInt8;
|
||||||
|
|
||||||
template <typename Result = ResultType>
|
template <typename Result = ResultType>
|
||||||
static inline Result apply(A a, B b)
|
NO_SANITIZE_UNDEFINED static inline Result apply(A a, B b)
|
||||||
{
|
{
|
||||||
return (typename NumberTraits::ToInteger<A>::Type(a) >> typename NumberTraits::ToInteger<B>::Type(b)) & 1;
|
return (typename NumberTraits::ToInteger<A>::Type(a) >> typename NumberTraits::ToInteger<B>::Type(b)) & 1;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
0
|
1
dbms/tests/queries/0_stateless/00967_ubsan_bit_test.sql
Normal file
1
dbms/tests/queries/0_stateless/00967_ubsan_bit_test.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
SELECT sum(ignore(bitTest(number, 65))) FROM numbers(10);
|
Loading…
Reference in New Issue
Block a user