mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Add error on too many pattern members for structure
This commit is contained in:
+9
-9
@@ -4680,17 +4680,17 @@ class WidthVisitor final : public VNVisitor {
|
||||
"Assignment pattern key not supported/understood: "
|
||||
<< patp->keyp()->prettyTypeName());
|
||||
}
|
||||
} else {
|
||||
} else if (memp) {
|
||||
// constant expr
|
||||
if (memp) {
|
||||
const std::pair<PatMap::iterator, bool> ret
|
||||
= patmap.emplace(memp, patp);
|
||||
if (!ret.second) {
|
||||
patp->v3error("Assignment pattern contains duplicate entry: "
|
||||
<< VN_AS(patp->keyp(), Text)->text());
|
||||
}
|
||||
memp = VN_AS(memp->nextp(), MemberDType);
|
||||
const std::pair<PatMap::iterator, bool> ret = patmap.emplace(memp, patp);
|
||||
if (!ret.second) {
|
||||
patp->v3error("Assignment pattern contains duplicate entry: "
|
||||
<< VN_AS(patp->keyp(), Text)->text());
|
||||
}
|
||||
memp = VN_AS(memp->nextp(), MemberDType);
|
||||
} else {
|
||||
patp->v3error(
|
||||
"Assignment pattern contains more entries than structure members");
|
||||
}
|
||||
} while (false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user