From 2171076e8113fb54dfc128357018f5f9d3f8494e Mon Sep 17 00:00:00 2001 From: pavel-t <36256989+pavel-t@users.noreply.github.com> Date: Fri, 6 Jul 2018 10:54:15 +0300 Subject: [PATCH] Avoid pointer overflow warning in wxPropertyGridPageState::DoRemoveFromSelection() Looks like gcc8.1 think 'sel' can be empty after initialization. Avoid this by copying only the remaining entries. --- src/propgrid/propgridpagestate.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index ad9fdc5858..870354a27f 100644 --- a/src/propgrid/propgridpagestate.cpp +++ b/src/propgrid/propgridpagestate.cpp @@ -1371,8 +1371,7 @@ void wxPropertyGridPageState::DoRemoveFromSelection( wxPGProperty* prop ) { // If first item (i.e. one with the active editor) was // deselected, then we need to take some extra measures. - wxArrayPGProperty sel = m_selection; - sel.erase( sel.begin() + i ); + wxArrayPGProperty sel(m_selection.begin() + 1, m_selection.end()); wxPGProperty* newFirst = sel.empty()? NULL: sel[0];