From 4cc09afeacafc4f32e9dc5d9726a23593f20d3dc Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Thu, 25 Feb 2021 17:51:12 -0500 Subject: [PATCH] Corrected some errors relating to distributed allocation of node area and perimeter across devices. The distributed allocation was missing for hierarchical output, and the function that accumulates values per resistance class was initializing by iterating over device classes, not resistance classes, leading to a segfault if the number of device classes is larger than the number of resistance classes. --- ext2spice/ext2hier.c | 2 ++ ext2spice/ext2spice.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ext2spice/ext2hier.c b/ext2spice/ext2hier.c index b8dff398..c8685430 100644 --- a/ext2spice/ext2hier.c +++ b/ext2spice/ext2hier.c @@ -1892,6 +1892,8 @@ esHierVisit(hc, cdata) freeMagic(p); devMergeList = NULL; } + else if (esDistrJunct) + EFHierVisitDevs(hcf, devDistJunctHierVisit, (ClientData)NULL); /* Output devices */ EFHierVisitDevs(hcf, spcdevHierVisit, (ClientData)NULL); diff --git a/ext2spice/ext2spice.c b/ext2spice/ext2spice.c index 976ab6b8..01442a7f 100644 --- a/ext2spice/ext2spice.c +++ b/ext2spice/ext2spice.c @@ -3973,7 +3973,7 @@ update_w(resClass, w, n) { (nc->m_w.widths) = (float *)mallocMagic((unsigned)sizeof(float) * efNumResistClasses); - for (i = 0; i < EFDevNumTypes; i++) + for (i = 0; i < efNumResistClasses; i++) nc->m_w.widths[i] = 0.0; } nc->m_w.widths[resClass] += (float)w;