mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
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:
@@ -3918,6 +3918,11 @@ class LinkDotResolveVisitor final : public VNVisitor {
|
||||
// Primitive parameter is really a delay2 we can just ignore
|
||||
VL_DO_DANGLING(pushDeletep(nodep->unlinkFrBack()), nodep);
|
||||
return;
|
||||
} else if (nodep->param() && !nodep->exprp() && !nodep->svDotName()) {
|
||||
// Placeholder pin the parser makes for an empty '#()', to signal
|
||||
// the user did type the '#()'. No further use, deleting.
|
||||
VL_DO_DANGLING(pushDeletep(nodep->unlinkFrBack()), nodep);
|
||||
return;
|
||||
} else {
|
||||
const std::string suggest
|
||||
= (nodep->param() ? m_statep->suggestSymFlat(m_pinSymp, nodep->name(),
|
||||
|
||||
Reference in New Issue
Block a user