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:
parent
f254d62cb1
commit
e1a810c046
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user