mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Reset Yul string repository before each compilation.
This commit is contained in:
committed by
chriseth
parent
b95eebee1c
commit
dbae0fa939
@@ -29,17 +29,16 @@ void VarDeclInitializer::operator()(Block& _block)
|
||||
{
|
||||
ASTModifier::operator()(_block);
|
||||
|
||||
static Expression const zero{Literal{{}, LiteralKind::Number, YulString{"0"}, {}}};
|
||||
|
||||
using OptionalStatements = boost::optional<vector<Statement>>;
|
||||
GenericFallbackReturnsVisitor<OptionalStatements, VariableDeclaration> visitor{
|
||||
[](VariableDeclaration& _varDecl) -> OptionalStatements
|
||||
{
|
||||
if (_varDecl.value)
|
||||
return {};
|
||||
else if (_varDecl.variables.size() == 1)
|
||||
Literal zero{{}, LiteralKind::Number, YulString{"0"}, {}};
|
||||
if (_varDecl.variables.size() == 1)
|
||||
{
|
||||
_varDecl.value = make_unique<Expression>(zero);
|
||||
_varDecl.value = make_unique<Expression>(std::move(zero));
|
||||
return {};
|
||||
}
|
||||
else
|
||||
@@ -47,7 +46,7 @@ void VarDeclInitializer::operator()(Block& _block)
|
||||
OptionalStatements ret{vector<Statement>{}};
|
||||
langutil::SourceLocation loc{std::move(_varDecl.location)};
|
||||
for (auto& var: _varDecl.variables)
|
||||
ret->push_back(VariableDeclaration{loc, {std::move(var)}, make_unique<Expression>(zero)});
|
||||
ret->emplace_back(VariableDeclaration{loc, {std::move(var)}, make_unique<Expression>(zero)});
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user