forked from github/verilator
Internals: Avoid broken recusion
This commit is contained in:
parent
33c9591a4b
commit
5d8c1ce84e
@ -208,8 +208,8 @@ private:
|
|||||||
nodep->v3fatalSrc("Broken link in node (or something without maybePointedTo)");
|
nodep->v3fatalSrc("Broken link in node (or something without maybePointedTo)");
|
||||||
}
|
}
|
||||||
if (nodep->dtypep()) {
|
if (nodep->dtypep()) {
|
||||||
if (!nodep->dtypep()->brokeExists()) { nodep->v3error("Broken link in node->dtypep()"); }
|
if (!nodep->dtypep()->brokeExists()) { nodep->v3fatalSrc("Broken link in node->dtypep() to "<<(void*)nodep->dtypep()); }
|
||||||
else if (!nodep->dtypep()->castNodeDType()) { nodep->v3error("Non-dtype link in node->dtypep()"); }
|
else if (!nodep->dtypep()->castNodeDType()) { nodep->v3fatalSrc("Non-dtype link in node->dtypep() to "<<(void*)nodep->dtypep()); }
|
||||||
}
|
}
|
||||||
if (v3Global.assertDTypesResolved()) {
|
if (v3Global.assertDTypesResolved()) {
|
||||||
if (nodep->hasDType()) {
|
if (nodep->hasDType()) {
|
||||||
@ -246,10 +246,18 @@ public:
|
|||||||
|
|
||||||
void V3Broken::brokenAll(AstNetlist* nodep) {
|
void V3Broken::brokenAll(AstNetlist* nodep) {
|
||||||
//UINFO(9,__FUNCTION__<<": "<<endl);
|
//UINFO(9,__FUNCTION__<<": "<<endl);
|
||||||
BrokenTable::prepForTree();
|
static bool inBroken = false;
|
||||||
BrokenMarkVisitor mvisitor (nodep);
|
if (inBroken) {
|
||||||
BrokenCheckVisitor cvisitor (nodep);
|
// A error called by broken can recurse back into broken; avoid this
|
||||||
BrokenTable::doneWithTree();
|
UINFO(1,"Broken called under broken, skipping recursion.\n");
|
||||||
|
} else {
|
||||||
|
inBroken = true;
|
||||||
|
BrokenTable::prepForTree();
|
||||||
|
BrokenMarkVisitor mvisitor (nodep);
|
||||||
|
BrokenCheckVisitor cvisitor (nodep);
|
||||||
|
BrokenTable::doneWithTree();
|
||||||
|
inBroken = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void V3Broken::addNewed(AstNode* nodep) {
|
void V3Broken::addNewed(AstNode* nodep) {
|
||||||
|
Loading…
Reference in New Issue
Block a user