Assertion checking for hole/parent ownership mismatch.

(This mismatch is the root of the problem in issue #14852.)
This commit is contained in:
Jeff Young 2023-06-02 17:49:06 +01:00
parent df4fefeb20
commit 3c8d2bfca5
1 changed files with 11 additions and 0 deletions

View File

@ -94,7 +94,18 @@ NODE::~NODE()
for( ITEM* item : *m_index )
{
if( item->BelongsTo( this ) && item->OfKind( ITEM::HOLE_T ) )
{
#ifdef DEBUG
HOLE* hole = static_cast<HOLE*>( item );
// If a hole is no longer owned by the same NODE as its parent then we're in a
// heap of trouble.
if( hole->ParentPadVia() && !hole->ParentPadVia()->BelongsTo( this ) )
assert( false );
#endif
toDelete.push_back( item );
}
}
for( const ITEM* item : toDelete )