Duplicate ScalarSignal creation (signal & global) in VhdlEntity.

* Bug: In CRL Core, in VhdlEntity, when a scalar signal is also global,
    two ScalarSignal where created, but only one can be linked as a
    property on a Net. So when the one *not* linked as a property was
    deleted, an infinite loop started (under Cygwin at least).
      The _globals list now contains pointers to signals that are in
    _signals. The _globals elements no longer needs to be deleted.
This commit is contained in:
Jean-Paul Chaput 2016-03-03 18:14:20 +01:00
parent fce97bb1d9
commit 12ac23713e
1 changed files with 4 additions and 3 deletions

View File

@ -132,9 +132,10 @@ namespace Vhdl {
signal->addNet( index, net ); signal->addNet( index, net );
_signals.insert( signal ); _signals.insert( signal );
} else { } else {
_signals.insert( new ScalarSignal(net) ); ScalarSignal* signal = new ScalarSignal(net);
_signals.insert( signal );
if (net->isGlobal()) if (net->isGlobal())
_globals.insert( new ScalarSignal(net) ); _globals.insert( signal );
} }
} }
@ -145,7 +146,7 @@ namespace Vhdl {
Entity::~Entity () Entity::~Entity ()
{ {
for ( auto signal : _signals ) delete signal; for ( auto signal : _signals ) delete signal;
for ( auto global : _globals ) delete global; //for ( auto global : _globals ) delete global;
for ( auto ientity=_entities.begin() ; ientity!=_entities.end() ; ++ientity ) { for ( auto ientity=_entities.begin() ; ientity!=_entities.end() ; ++ientity ) {
if (*ientity == this) { if (*ientity == this) {
_entities.erase( ientity ); _entities.erase( ientity );