Fix coredump from increment patch (#2391)

This commit is contained in:
Wilson Snyder 2020-06-03 08:30:49 -04:00
parent c3271aa891
commit ef71576825

View File

@ -190,7 +190,8 @@ private:
// Prepare a temporary variable // Prepare a temporary variable
FileLine* fl = backp->fileline(); FileLine* fl = backp->fileline();
string name = string("__Vincrement") + cvtToStr(++m_modIncrementsNum); 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 // Declare the variable
insertBeforeStmt(nodep, varp); insertBeforeStmt(nodep, varp);