Improve scoping control of connetion members.

(The real bug here is that CONNECTION_GRAPH::assignNetCodesToBus() was
growing the bus aliases members list because it used a non-const
reference to it as a local storage list.  The const scoping of it will
prevent this type of error in future.)

Fixes https://gitlab.com/kicad/code/kicad/issues/14269
This commit is contained in:
Jeff Young
2023-04-04 12:03:06 +01:00
parent b3e2cf218f
commit 7e5cd01079
3 changed files with 2 additions and 7 deletions
+1 -1
View File
@@ -1770,7 +1770,7 @@ int CONNECTION_GRAPH::assignNewNetCode( SCH_CONNECTION& aConnection )
void CONNECTION_GRAPH::assignNetCodesToBus( SCH_CONNECTION* aConnection )
{
std::vector< std::shared_ptr<SCH_CONNECTION>>& connections_to_check( aConnection->Members() );
std::vector<std::shared_ptr<SCH_CONNECTION>> connections_to_check( aConnection->Members() );
for( unsigned i = 0; i < connections_to_check.size(); i++ )
{