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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -70,6 +70,7 @@ John Coiner
John Demme
Jonathan Drolet
Joseph Nwabueze
Josep Sans
Josh Redford
Julie Schwartz
Julien Margetts

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;