diff --git a/src/V3LinkParse.cpp b/src/V3LinkParse.cpp index 35698056a..d23edfe6e 100644 --- a/src/V3LinkParse.cpp +++ b/src/V3LinkParse.cpp @@ -362,7 +362,7 @@ private: // Definition must be inserted right after the variable (etc) that needed it // AstVar, AstTypedef, AstNodeFTask are common containers AstNode* backp = nodep->backp(); - for (; backp; backp=nodep->backp()) { + for (; backp; backp=backp->backp()) { if (backp->castVar()) break; else if (backp->castTypedef()) break; else if (backp->castNodeFTask()) break;