Fix crash in Anabatic::AntennaProtect.

* Bug: In Anabatic::AntennaProtect, if the diode cell exists *but* the
    maximum wire length for a diode is *not* defined (so zero) cancel
    the diode protection instead of making a divide by zero.
This commit is contained in:
Jean-Paul Chaput 2021-09-30 19:59:28 +02:00
parent 9c71ce8a03
commit 0d473e18c0
1 changed files with 6 additions and 1 deletions

View File

@ -1109,12 +1109,17 @@ namespace Anabatic {
}
EtesianEngine* etesian = static_cast<EtesianEngine*>
( ToolEngine::get( getCell(), EtesianEngine::staticGetName() ));
DbU::Unit segmentMaxWL = etesian->getAntennaDiodeMaxWL() / 2;
if (not etesian->getDiodeCell()) {
cerr << Warning( "AnabaticEngine::antennaProtect(): No diode cell found, skipped." ) << endl;
return;
}
if (etesian->getAntennaDiodeMaxWL() <= 0) {
cerr << Warning( "AnabaticEngine::antennaProtect(): Maximum antenna diode WL not set, skipped." ) << endl;
return;
}
DbU::Unit segmentMaxWL = etesian->getAntennaDiodeMaxWL() / 2;
cmess1 << " o Antenna effect protection." << endl;
startMeasures();