From 24e2991fe3a5a4a9bb1754d0235405e1a3a99673 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Thu, 25 Nov 2021 13:20:28 -0500 Subject: [PATCH] Corrected an error that happens if a layout file read flags a timestamp error, causing a segfault because it runs HashKill on a hash table that was never initialized. --- database/DBio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/database/DBio.c b/database/DBio.c index 2c8a6200..bd0a7b1f 100644 --- a/database/DBio.c +++ b/database/DBio.c @@ -420,6 +420,7 @@ dbCellReadDef(f, cellDef, name, ignoreTech, dereference) Rect r; int n = 1, d = 1; HashTable dbUseTable; + bool needcleanup = FALSE; /* * It's very important to disable interrupts during the body of @@ -666,6 +667,7 @@ dbCellReadDef(f, cellDef, name, ignoreTech, dereference) rp = &r; UndoDisable(); HashInit(&dbUseTable, 32, HT_STRINGKEYS); + needcleanup = TRUE; while (TRUE) { /* @@ -873,7 +875,7 @@ done: cellDef->cd_flags |= CDSTAMPSCHANGED|CDGETNEWSTAMP; } - HashKill(&dbUseTable); + if (needcleanup) HashKill(&dbUseTable); UndoEnable(); /* Disabled 3/16/2021. Let <> in file force a DRC check */ /* DRCCheckThis(cellDef, TT_CHECKPAINT, (Rect *) NULL); */