Avoid crashes when calling squeeze()
Avoid crashes when calling squeeze() on a QList with non zero capacity but zero size. Change-Id: Id470b2d52266a345b94bc3dc5483f4668fbb57dc Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
837a29b0b9
commit
13fcd02ff9
@ -187,7 +187,7 @@ public:
|
||||
qsizetype detachCapacity(qsizetype newSize) const noexcept { return d ? d->detachCapacity(newSize) : newSize; }
|
||||
const typename Data::ArrayOptions flags() const noexcept { return d ? typename Data::ArrayOption(d->flags) : Data::ArrayOptionDefault; }
|
||||
void setFlag(typename Data::ArrayOptions f) noexcept { Q_ASSERT(d); d->flags |= f; }
|
||||
void clearFlag(typename Data::ArrayOptions f) noexcept { Q_ASSERT(d); d->flags &= ~f; }
|
||||
void clearFlag(typename Data::ArrayOptions f) noexcept { if (d) d->flags &= ~f; }
|
||||
|
||||
Data *d_ptr() noexcept { return d; }
|
||||
void setBegin(T *begin) noexcept { ptr = begin; }
|
||||
|
Loading…
Reference in New Issue
Block a user