Fix _Vilp used before declaration (#4057) (#4062)

This commit is contained in:
Josep Sans
2023-03-24 11:51:02 +01:00
committed by GitHub
parent f439a7927f
commit 449ac44131
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -75,7 +75,10 @@ private:
const string newvarname{"__Vilp"};
varp = new AstVar{fl, VVarType::STMTTEMP, newvarname, VFlagLogicPacked{}, 32};
UASSERT_OBJ(cfuncp, fl, "Assignment not under a function");
cfuncp->addInitsp(varp);
if (cfuncp->initsp())
cfuncp->initsp()->addNextHere(varp);
else
cfuncp->addInitsp(varp);
cfuncp->user1p(varp);
}
return varp;