From e9d434597a9a01b45cce08bb42a9257c5eb0b50d Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Wed, 15 Mar 2023 14:36:15 -0400 Subject: [PATCH] Corrected issue with the commit of version 8.3.378, which can cause a crash when extracting some devices like bipolars with terminals on different plance. --- VERSION | 2 +- extract/ExtBasic.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 099f29de..895fc909 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.380 +8.3.381 diff --git a/extract/ExtBasic.c b/extract/ExtBasic.c index 4b37f310..ed24af75 100644 --- a/extract/ExtBasic.c +++ b/extract/ExtBasic.c @@ -2132,6 +2132,8 @@ extOutputDevices(def, transList, outFile) width /= n; if (n > 1) length = extTransRec.tr_gatelen / n; + else if (extTransRec.tr_gatelen < width) + length = extTransRec.tr_gatelen; else { /* Assumption: A device with a single terminal */ @@ -2175,10 +2177,12 @@ extOutputDevices(def, transList, outFile) { LinkedBoundary *lb; - extSpecialBounds = (LinkedBoundary **)mallocMagic(n * + extSpecialBounds = (LinkedBoundary **)mallocMagic( + extTransRec.tr_nterm * sizeof(LinkedBoundary *)); - for (i = 0; i < n; i++) extSpecialBounds[i] = NULL; + for (i = 0; i < extTransRec.tr_nterm; i++) + extSpecialBounds[i] = NULL; /* Mark with reg and process each perimeter segment */ @@ -2194,7 +2198,7 @@ extOutputDevices(def, transList, outFile) /* Free the lists */ - for (i = 0; i < n; i++) + for (i = 0; i < extTransRec.tr_nterm; i++) for (lb = extSpecialBounds[i]; lb != NULL; lb = lb->b_next) freeMagic((char *)lb); freeMagic((char *)extSpecialBounds);