Fix old and wrong assert

This commit is contained in:
Salvatore Mesoraca 2024-08-09 18:09:52 +02:00 committed by Robert Schulze
parent 4d0fc70227
commit ef2912b0f7
No known key found for this signature in database
GPG Key ID: 26703B55FB13728A
3 changed files with 7 additions and 2 deletions

View File

@ -83,8 +83,7 @@ namespace impl
{
assert(key0 && key1);
assert(key0->size() == key1->size());
assert(offsets == nullptr || offsets->size() == key0->size());
if (offsets != nullptr)
if (offsets != nullptr && !offsets->empty())
return offsets->back();
return key0->size();
}
@ -92,6 +91,8 @@ namespace impl
{
if (is_const)
i = 0;
assert(key0->size() == key1->size());
assert(key0->size() > i);
if (offsets != nullptr)
{
const auto *const begin = offsets->begin();

View File

@ -244,3 +244,5 @@ Check bug 3 found fuzzing
0AD04BFD000000000000000000000000
4761183170873013810
0AD04BFD000000000000000000000000
16734549324845627102
D675BB3D687973A238AB891DD99C7047

View File

@ -351,3 +351,5 @@ SELECT sipHash64Keyed((1::UInt64, 2::UInt64), []::Array(UInt8));
SELECT hex(sipHash128Keyed((1::UInt64, 2::UInt64), []::Array(UInt8)));
SELECT sipHash64Keyed((1::UInt64, 2::UInt64), mapFromArrays([], []));
SELECT hex(sipHash128Keyed((1::UInt64, 2::UInt64), mapFromArrays([], [])));
SELECT sipHash64Keyed((1::UInt64, 2::UInt64), map([0], 1, [2], 3));
SELECT hex(sipHash128Keyed((0::UInt64, 0::UInt64), map([0], 1, [2], 3)));