mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #5593 from ethereum/issue-5384
Fix expression simplifier asserting on default values
This commit is contained in:
commit
32c9da9419
@ -114,7 +114,8 @@ bool Pattern::matches(Expression const& _expr, map<YulString, Expression const*>
|
||||
{
|
||||
YulString varName = boost::get<Identifier>(_expr).name;
|
||||
if (_ssaValues.count(varName))
|
||||
expr = _ssaValues.at(varName);
|
||||
if (Expression const* new_expr = _ssaValues.at(varName))
|
||||
expr = new_expr;
|
||||
}
|
||||
assertThrow(expr, OptimizerException, "");
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
// c & d can't be optimized as expression simplifier doesn't handle default
|
||||
// values yet
|
||||
{
|
||||
let c
|
||||
let d
|
||||
let y := add(d, add(c, 7))
|
||||
}
|
||||
// ----
|
||||
// expressionSimplifier
|
||||
// {
|
||||
// let c
|
||||
// let d
|
||||
// let y := add(add(d, c), 7)
|
||||
// }
|
Loading…
Reference in New Issue
Block a user