Avoid ngspice segfault
When simulating an empty netlist, calling the `.save all` and `.probe alli` commands gives a segfault in ngspice. We can avoid this by skipping these commands in KiCad. Fixes https://gitlab.com/kicad/code/kicad/issues/12938
This commit is contained in:
parent
01cf6d76d8
commit
d23f285f8c
|
@ -127,7 +127,11 @@ bool NETLIST_EXPORTER_SPICE::DoWriteNetlist( OUTPUTFORMATTER& aFormatter, unsign
|
|||
|
||||
writeIncludes( aFormatter, aNetlistOptions );
|
||||
writeModels( aFormatter );
|
||||
WriteDirectives( aFormatter, aNetlistOptions );
|
||||
|
||||
// Skip this if there is no netlist to avoid an ngspice segfault
|
||||
if( !m_items.empty() )
|
||||
WriteDirectives( aFormatter, aNetlistOptions );
|
||||
|
||||
writeItems( aFormatter );
|
||||
|
||||
WriteTail( aFormatter, aNetlistOptions );
|
||||
|
|
Loading…
Reference in New Issue