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
+6 -1
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;
}
}