QVLA: add a Q_ASSERT

GCC's -fanalyzer complains that `ptr` might be null. It's actually
never null (by class invariant).

Change-Id: I5660b1e766b2cfde3f042b8e87168987e7618591
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Giuseppe D'Angelo 2021-01-17 19:13:29 +01:00
parent f254d62cb1
commit e1a810c046

View File

@ -492,6 +492,7 @@ template <class T, qsizetype Prealloc>
Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::reallocate(qsizetype asize, qsizetype aalloc)
{
Q_ASSERT(aalloc >= asize);
Q_ASSERT(ptr);
T *oldPtr = ptr;
qsizetype osize = s;