From 4da28cf8f4b1a276ccd6bfde877fa2e3610c6340 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 19 Jan 2021 08:39:18 -0800 Subject: [PATCH] Fix bad dereference Fixes https://gitlab.com/kicad/code/kicad/issues/7188 --- eeschema/tools/backannotate.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eeschema/tools/backannotate.cpp b/eeschema/tools/backannotate.cpp index a781bcfa14..93e4bea4a7 100644 --- a/eeschema/tools/backannotate.cpp +++ b/eeschema/tools/backannotate.cpp @@ -281,16 +281,18 @@ void BACK_ANNOTATE::checkForUnusedSymbols() // generate errors before we will find m_refs member to which item linked while( i < m_refs.GetCount() && m_refs[i].GetPath() != item.first.GetPath() ) { - const SCH_REFERENCE& ref = m_refs[i++]; + const SCH_REFERENCE& ref = m_refs[i]; if( ref.GetSymbol()->GetIncludeOnBoard() ) { wxString msg = wxString::Format( _( "Footprint '%s' is not present on PCB. " "Corresponding symbols in schematic must be " "manually deleted (if desired)." ), - m_refs[i++].GetFullRef() ); + m_refs[i].GetFullRef() ); m_reporter.ReportTail( msg, RPT_SEVERITY_WARNING ); } + + ++i; } ++i;