mirror of
https://github.com/verilator/verilator.git
synced 2025-01-19 12:54:02 +00:00
Fix detecting multiple pattern defaults
This commit is contained in:
parent
24198ef0ed
commit
9255707dd4
@ -3732,13 +3732,14 @@ private:
|
||||
}
|
||||
}
|
||||
AstPatMember* defaultp = nullptr;
|
||||
for (AstPatMember* patp = VN_AS(nodep->itemsp(), PatMember); patp;
|
||||
patp = VN_AS(patp->nextp(), PatMember)) {
|
||||
for (AstPatMember* patp = VN_AS(nodep->itemsp(), PatMember); patp;) {
|
||||
AstPatMember* const nextp = VN_AS(patp->nextp(), PatMember);
|
||||
if (patp->isDefault()) {
|
||||
if (defaultp) nodep->v3error("Multiple '{ default: } clauses");
|
||||
defaultp = patp;
|
||||
patp->unlinkFrBack();
|
||||
}
|
||||
patp = nextp;
|
||||
}
|
||||
while (const AstConstDType* const vdtypep = VN_CAST(dtypep, ConstDType)) {
|
||||
dtypep = vdtypep->subDTypep()->skipRefp();
|
||||
|
Loading…
Reference in New Issue
Block a user