Corrected an error causing weird and undefined behavior when

extracting substrate regions, due to failure to clean up the tagged
tiles after exiting a search due to finding a substrate type that
was not the global substrate.
This commit is contained in:
Tim Edwards 2021-04-05 14:16:28 -04:00
parent 9aa9fb53c4
commit fca21c8fc0
2 changed files with 8 additions and 21 deletions

View File

@ -1821,26 +1821,8 @@ extOutputDevices(def, transList, outFile)
extTransFindSubs(reg->treg_tile, t, tmask, def, &node, NULL);
if ((node == NULL) && (TTMaskHasType(tmask, TT_SPACE))) {
/* Device node is possibly the substrate. But: Note */
/* that TT_SPACE in the mask covers all planes, and it */
/* is not possible to specify TT_SPACE in a single */
/* plane. So it is necessary to check for any */
/* shielding types that block the substrate. */
if (!TTMaskIsZero(&ExtCurStyle->exts_globSubstrateShieldTypes))
{
extTransFindSubs(reg->treg_tile, t,
&ExtCurStyle->exts_globSubstrateShieldTypes,
def, &node, NULL);
}
if ((glob_subsnode == NULL) || (node != NULL)) {
/* See if there is another matching device record */
/* with a different terminal type, and try again. */
devptr = extDevFindMatch(devptr, t);
break;
}
else if ((node == NULL) && (glob_subsnode != NULL))
node = glob_subsnode;
/* Device node is the global substrate. */
node = glob_subsnode;
}
else if (node == NULL) {
/* See if there is another matching device record */

View File

@ -127,7 +127,11 @@ extHierSubstrate(ha, use, x, y)
/* Find the child's substrate node */
nodeList = extFindNodes(use->cu_def, (Rect *) NULL, TRUE);
if (nodeList == NULL) return;
if (nodeList == NULL)
{
ExtResetTiles(use->cu_def, extUnInit);
return;
}
/* Check if the child's substrate node is covered by any substrate */
/* shield type (e.g., deep nwell). This is a stupid-simple check */
@ -161,6 +165,7 @@ extHierSubstrate(ha, use, x, y)
extHierSubShieldFunc, (ClientData)NULL) != 0)
{
freeMagic(nodeList);
ExtResetTiles(use->cu_def, extUnInit);
return;
}
}