all: more assorted cleanups

This commit is contained in:
Markus F.X.J. Oberhumer
2023-01-29 11:39:57 +01:00
parent 340b7614e2
commit 5056215a1f
21 changed files with 107 additions and 65 deletions
+3 -1
View File
@@ -200,7 +200,9 @@ template <class T>
inline typename Ptr<T>::pointer raw_index_bytes(const Ptr<T> &a, size_t index,
size_t size_in_bytes) {
typedef typename Ptr<T>::element_type element_type;
return raw_bytes(a, mem_size(sizeof(element_type), index, size_in_bytes)) + index;
if very_unlikely (a.raw_ptr() == nullptr)
throwInternalError("raw_index_bytes unexpected NULL ptr");
return a.raw_bytes(mem_size(sizeof(element_type), index, size_in_bytes)) + index;
}
/*************************************************************************