aboutsummaryrefslogtreecommitdiffstats
path: root/libyul/optimiser/Disambiguator.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-01-20 00:23:49 +0800
committerchriseth <chris@ethereum.org>2018-10-17 20:12:11 +0800
commit16c2a775fd532c301eae3abecc8d68c5c421a9a0 (patch)
treee026394334ac6cae6eda20302a13d24fbfcd83f9 /libyul/optimiser/Disambiguator.cpp
parent5e01d767d02d064a064a67dcf95ee299c46f741f (diff)
downloaddexon-solidity-16c2a775fd532c301eae3abecc8d68c5c421a9a0.tar.gz
dexon-solidity-16c2a775fd532c301eae3abecc8d68c5c421a9a0.tar.zst
dexon-solidity-16c2a775fd532c301eae3abecc8d68c5c421a9a0.zip
Handle externally supplied variables correctly in disambiguator.
Diffstat (limited to 'libyul/optimiser/Disambiguator.cpp')
-rw-r--r--libyul/optimiser/Disambiguator.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libyul/optimiser/Disambiguator.cpp b/libyul/optimiser/Disambiguator.cpp
index af3507e1..dcba97c9 100644
--- a/libyul/optimiser/Disambiguator.cpp
+++ b/libyul/optimiser/Disambiguator.cpp
@@ -34,6 +34,9 @@ using Scope = dev::solidity::assembly::Scope;
string Disambiguator::translateIdentifier(string const& _originalName)
{
+ if ((m_externallyUsedIdentifiers.count(_originalName)))
+ return _originalName;
+
assertThrow(!m_scopes.empty() && m_scopes.back(), OptimizerException, "");
Scope::Identifier const* id = m_scopes.back()->lookup(_originalName);
assertThrow(id, OptimizerException, "");