diff options
author | ponasenko-rs <ponasenko-rs@yandex-team.com> | 2023-08-30 12:02:03 +0300 |
---|---|---|
committer | ponasenko-rs <ponasenko-rs@yandex-team.com> | 2023-08-30 12:24:50 +0300 |
commit | d7212c5b8f972c2ad657311361a3bd1b136f2c5f (patch) | |
tree | 4d00b432f21ab3e7f334c2df3c50cc51e5b0b599 | |
parent | 0910821c430f4f7a10ede9d84f20a68a40daf9d7 (diff) | |
download | ydb-d7212c5b8f972c2ad657311361a3bd1b136f2c5f.tar.gz |
YT-19895: Fix lock set for key columns.
-rw-r--r-- | yt/yt/client/table_client/schema-inl.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/yt/yt/client/table_client/schema-inl.h b/yt/yt/client/table_client/schema-inl.h index e2949f6aa9..7e9c1590c1 100644 --- a/yt/yt/client/table_client/schema-inl.h +++ b/yt/yt/client/table_client/schema-inl.h @@ -18,11 +18,13 @@ inline TLegacyLockMask::TLegacyLockMask(TLegacyLockBitmap value) inline ELockType TLegacyLockMask::Get(int index) const { + YT_VERIFY(index >= 0); return ELockType((Data_ >> (BitsPerType * index)) & TypeMask); } inline void TLegacyLockMask::Set(int index, ELockType lock) { + YT_VERIFY(index >= 0); YT_VERIFY(lock <= MaxOldLockType); Data_ &= ~(TypeMask << (BitsPerType * index)); Data_ |= static_cast<TLegacyLockBitmap>(lock) << (BitsPerType * index); @@ -54,6 +56,7 @@ inline TLockMask::TLockMask(TLockBitmap bitmap, int size) inline ELockType TLockMask::Get(int index) const { + YT_VERIFY(index >= 0); auto wordIndex = index / LocksPerWord; if (wordIndex < std::ssize(Bitmap_)) { auto wordPosition = index & (LocksPerWord - 1); @@ -66,6 +69,7 @@ inline ELockType TLockMask::Get(int index) const inline void TLockMask::Set(int index, ELockType lock) { + YT_VERIFY(index >= 0); if (index >= Size_) { Reserve(index + 1); } |