From a34f08b20ade49eb153e5218052e1f55bf85014d Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Wed, 4 Mar 2020 15:17:42 -0500 Subject: [PATCH] Corrected problem in flattening code that would attempt to flatten a cell that mismatched by having zero instances. Which fails and repeats indefinitely. --- base/flatten.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/flatten.c b/base/flatten.c index 96bfdce..d873033 100644 --- a/base/flatten.c +++ b/base/flatten.c @@ -1539,7 +1539,7 @@ PrematchLists(char *name1, int file1, char *name2, int file2) /* (it without regard to cell1) improves the matching. */ else if ((ecomp->num1 != ecomp->num2) && (ecomp->cell2 != NULL) && - (ecomp->cell2->class == CLASS_SUBCKT)) { + (ecomp->num2 != 0) && (ecomp->cell2->class == CLASS_SUBCKT)) { ecomp->add2 = -ecomp->num2; match = 1; for (ob2 = ecomp->cell2->cell; ob2; ob2 = ob2->next) { @@ -1597,7 +1597,7 @@ PrematchLists(char *name1, int file1, char *name2, int file2) /* (it without regard to cell1) improves the matching. */ else if ((ecomp->num1 != ecomp->num2) && (ecomp->cell1 != NULL) && - (ecomp->cell1->class == CLASS_SUBCKT)) { + (ecomp->num1 != 0) && (ecomp->cell1->class == CLASS_SUBCKT)) { ecomp->add1 = -ecomp->num1; match = 1; for (ob2 = ecomp->cell1->cell; ob2; ob2 = ob2->next) {