diff --git a/src/V3LinkInc.cpp b/src/V3LinkInc.cpp index 9c8a645b1..73dbe7ab5 100644 --- a/src/V3LinkInc.cpp +++ b/src/V3LinkInc.cpp @@ -190,7 +190,8 @@ private: // Prepare a temporary variable FileLine* fl = backp->fileline(); string name = string("__Vincrement") + cvtToStr(++m_modIncrementsNum); - AstVar* varp = new AstVar(fl, AstVarType::BLOCKTEMP, name, varrefp->varp()->subDTypep()); + AstVar* varp = new AstVar(fl, AstVarType::BLOCKTEMP, name, VFlagChildDType(), + varrefp->varp()->subDTypep()->cloneTree(true)); // Declare the variable insertBeforeStmt(nodep, varp);