Skip to content

QVarLengthArray: assert that the range passed to erase() is valid

We already checked that the two iterators, indvidually, are valid, but we didn't check that the range formed by them is valid, namely that the end iterator is reachable from the start iterator.

Add an assert, because if the range isn't valid, we run into UB in the std::move() algorithm two lines later.

Qt 5.15 uses std::copy() here, which has the same precondition, so the assertion would make sense there, too.

Pick-to: 6.2 5.15 Change-Id: I90b7e846455ff86383a8971bea908036684961d8 Reviewed-by: Thiago Macieira thiago.macieira@intel.com (cherry picked from commit c3863908)

Merge request reports