summaryrefslogtreecommitdiffstats
path: root/src/common/util/Queue.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/util/Queue.h')
-rw-r--r--src/common/util/Queue.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/util/Queue.h b/src/common/util/Queue.h
index 10c7f0f5..a4c34222 100644
--- a/src/common/util/Queue.h
+++ b/src/common/util/Queue.h
@@ -66,6 +66,7 @@ Queue<T>::Queue(size_t size)
m_size(size+1),
m_objects((T*)calloc(m_size, sizeof(T)))
{
+ assert(size > 1);
}
@@ -147,6 +148,7 @@ inline T&
Queue<T>::pop()
{
assert(!is_empty());
+ assert(m_size > 0);
T& r = m_objects[m_front];
m_front = (m_front + 1) % (m_size);