Skip to content

Commit

Permalink
🐛 Added a conditional check to ensure current_pis vector is not empty…
Browse files Browse the repository at this point in the history
… before accessing its elements.
  • Loading branch information
Drewniok committed Mar 28, 2024
1 parent 93a37e8 commit 9760dbf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions include/mockturtle/views/names_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@ class names_view : public Ntk
current_pis.emplace_back( Ntk::make_signal( n ) );
} );
named_ntk.foreach_pi( [&]( auto const& n, auto i ) {
if ( const auto it = _signal_names.find( current_pis[i] ); it != _signal_names.end() )
new_signal_names[named_ntk.make_signal( n )] = it->second;
if ( !current_pis.empty() )
{
if ( const auto it = _signal_names.find( current_pis[i] ); it != _signal_names.end() )
new_signal_names[named_ntk.make_signal( n )] = it->second;
}
} );

Ntk::operator=( named_ntk );
Expand Down

0 comments on commit 9760dbf

Please sign in to comment.