Skip to content

Commit

Permalink
Bdlc packedintarray ubsan drqs 176630428 (#4955)
Browse files Browse the repository at this point in the history
  • Loading branch information
lalawawa authored and GitHub Enterprise committed Sep 16, 2024
1 parent 04d8378 commit 75a1143
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion groups/bdl/bdlc/bdlc_flathashmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ class FlatHashMap {
try_emplace(const_iterator, const KEY& key, ARGS&&... args);

/// If a key equivalent to the specified `key` already exists in this
/// map, return an iterator referring to the existing item. Otherwise,
/// map, return an iterator referring to the existing item. Otherwise,
/// insert into this map a newly-created `value_type` object,
/// constructed from `std::forward<KEY>(key)` and the specified `args`,
/// and return an iterator referring to the newly-created entry. This
Expand Down
8 changes: 5 additions & 3 deletions groups/bdl/bdlc/bdlc_packedintarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -1664,9 +1664,11 @@ void PackedIntArrayImp<STORAGE>::remove(bsl::size_t dstIndex,

d_length -= numElements;

bsl::memmove(address() + dstIndex * d_bytesPerElement,
address() + (dstIndex + numElements) * d_bytesPerElement,
(d_length - dstIndex) * d_bytesPerElement);
if (address()) {
bsl::memmove(address() + dstIndex * d_bytesPerElement,
address() + (dstIndex + numElements) * d_bytesPerElement,
(d_length - dstIndex) * d_bytesPerElement);
}
}

template <class STORAGE>
Expand Down

0 comments on commit 75a1143

Please sign in to comment.