Added code to avoid a segfault if a resistor or capacitor is

specified without a list of substrate connection types, but
the "s=" parameter is used, resulting in an attempt to access a
substrate node that does not exist.
This commit is contained in:
R. Timothy Edwards 2025-10-06 14:14:05 -04:00
parent d6d8620a7c
commit 5e74ecf9fa
1 changed files with 7 additions and 3 deletions

View File

@ -343,7 +343,11 @@ spcHierWriteParams(
break;
case 's':
fprintf(esSpiceF, " %s=", plist->parm_name);
/*EFNode *subnodeFlat =*/ spcdevSubstrate(hc->hc_hierName,
if (dev->dev_subsnode == NULL)
TxError("Error: Device %s missing substrate node!\n",
EFDevTypes[dev->dev_type]);
else
spcdevSubstrate(hc->hc_hierName,
dev->dev_subsnode->efnode_name->efnn_hier,
dev->dev_type, esSpiceF);
break;