We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3fb05b commit 1a4754cCopy full SHA for 1a4754c
compiler-rt/lib/sanitizer_common/sanitizer_ring_buffer.h
@@ -47,7 +47,9 @@ class RingBuffer {
47
void push(T t) {
48
*next_ = t;
49
next_--;
50
- // The condition below works only if sizeof(T) is divisible by sizeof(T*).
+ static_assert((sizeof(T) % sizeof(T *)) == 0,
51
+ "The condition below works only if sizeof(T) is divisible by "
52
+ "sizeof(T*).");
53
if (next_ <= reinterpret_cast<T*>(&next_))
54
next_ = last_;
55
}
0 commit comments