SSAValueTracker should only use nullptr for default values

This commit is contained in:
Mathias Baumann 2018-12-05 12:22:18 +01:00
parent f4e9c70ecc
commit d0204eef2f
2 changed files with 3 additions and 1 deletions

View File

@ -37,7 +37,7 @@ void SSAValueTracker::operator()(VariableDeclaration const& _varDecl)
{ {
if (_varDecl.variables.size() == 1) if (_varDecl.variables.size() == 1)
setValue(_varDecl.variables.front().name, _varDecl.value.get()); setValue(_varDecl.variables.front().name, _varDecl.value.get());
else else if (!_varDecl.value)
for (auto const& var: _varDecl.variables) for (auto const& var: _varDecl.variables)
setValue(var.name, nullptr); setValue(var.name, nullptr);
} }

View File

@ -33,6 +33,8 @@ namespace yul
* Class that walks the AST and stores the initial value of each variable * Class that walks the AST and stores the initial value of each variable
* that is never assigned to. * that is never assigned to.
* *
* Default value is represented as nullptr.
*
* Prerequisite: Disambiguator * Prerequisite: Disambiguator
*/ */
class SSAValueTracker: public ASTWalker class SSAValueTracker: public ASTWalker