From b48cdff89ececeb4d667e8349c1cade48e587189 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Fri, 30 Jul 2021 17:42:16 +0100 Subject: [PATCH] Fix segfault in wildcard port connection with unnamed port (issue #530). A module port list may contain unnamed entries, e.g. module dut(a,); When performing a wildcard connection, these entries should be skipped, as there is no name to match. (cherry picked from commit 061121203bc27203b0ea1423cfd031c7381c111f) --- elaborate.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elaborate.cc b/elaborate.cc index 33ef74ac7..87d253424 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -1200,7 +1200,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const // Handle wildcard named port if (pins_[idx].name[0] == '*') { for (unsigned j = 0 ; j < nexp ; j += 1) { - if ((!pins[j]) && (!pins_is_explicitly_not_connected[j])) { + if (rmod->ports[j] && !pins[j] && !pins_is_explicitly_not_connected[j]) { pins_fromwc[j] = true; NetNet* net = 0; const NetExpr*par = 0;