mirror of
https://github.com/verilator/verilator.git
synced 2025-01-09 16:17:36 +00:00
Fix infinite loop on some V3Ast internal errors.
This commit is contained in:
parent
9a54b2144b
commit
9807025618
@ -1107,7 +1107,13 @@ void AstNode::v3errorEndFatal(std::ostringstream& str) const {
|
||||
string AstNode::locationStr() const {
|
||||
string str = "... In instance ";
|
||||
const AstNode* backp = this;
|
||||
int itmax = 10000; // Max iterations before giving up on location search
|
||||
while (backp) {
|
||||
if (--itmax < 0) {
|
||||
// Likely some circular back link, and V3Ast is trying to report a low-level error
|
||||
UINFO(1, "Ran out of iterations finding locationStr on " << backp << endl);
|
||||
return "";
|
||||
}
|
||||
const AstScope* scopep;
|
||||
if ((scopep = VN_CAST_CONST(backp, Scope))) {
|
||||
// The design is flattened and there are no useful scopes
|
||||
|
Loading…
Reference in New Issue
Block a user