Fix crash on empty '#()' parameter list on class instance (#8182)

The following used to crash:

```systemverilog
    class base #(type T = int); endclass
    class derived extends base; endclass
    derived #() d; // <- crash due to '#()'
```
This commit is contained in:
Geza Lore
2026-08-21 18:16:09 +02:00
committed by GitHub
parent a7ecba4f4e
commit d1067002da
4 changed files with 132 additions and 2 deletions
+4 -2
View File
@@ -1886,8 +1886,10 @@ class ParamProcessor final {
std::vector<AstPin*> pinsByIndex;
pinsByIndex.resize(m_classTypeParams.size(), nullptr);
for (AstPin* pinp = paramsp; pinp; pinp = VN_AS(pinp->nextp(), Pin)) {
if (AstParamTypeDType* typep = pinp->modPTypep()) {
pinsByIndex[m_paramIndex[typep]] = pinp;
AstParamTypeDType* const typep = pinp->modPTypep();
const auto it = typep ? m_paramIndex.find(typep) : m_paramIndex.end();
if (it != m_paramIndex.end()) {
pinsByIndex[it->second] = pinp;
} else {
pinsByIndex.push_back(pinp);
}