aboutsummaryrefslogtreecommitdiffstats
path: root/libyul/optimiser
diff options
context:
space:
mode:
authorMathias Baumann <marenz@supradigital.org>2018-12-05 18:24:55 +0800
committerMathias Baumann <marenz@supradigital.org>2018-12-05 18:43:02 +0800
commit54846ed0a708d57d25ac5eadd618f8137867df66 (patch)
tree7b69e0966f732230a18e65563d13ca4064698671 /libyul/optimiser
parent5d31ad2dafed4354ef4da5f798dba0b0eacad92d (diff)
downloaddexon-solidity-54846ed0a708d57d25ac5eadd618f8137867df66.tar.gz
dexon-solidity-54846ed0a708d57d25ac5eadd618f8137867df66.tar.zst
dexon-solidity-54846ed0a708d57d25ac5eadd618f8137867df66.zip
Fix expression simplifier asserting on default values
Diffstat (limited to 'libyul/optimiser')
-rw-r--r--libyul/optimiser/SimplificationRules.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libyul/optimiser/SimplificationRules.cpp b/libyul/optimiser/SimplificationRules.cpp
index b3190fef..8ed63fa8 100644
--- a/libyul/optimiser/SimplificationRules.cpp
+++ b/libyul/optimiser/SimplificationRules.cpp
@@ -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, "");