diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-04-21 01:44:07 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-04-21 02:20:14 +0800 |
commit | bf074f3f4174f31524d25da816cb4121a21da20c (patch) | |
tree | 90ef7c763532016b288e4b357a3d533440878e0a /libsolidity/interface | |
parent | 6468955fb1337f0f3d8eb4f35004d78179b8d7b8 (diff) | |
download | dexon-solidity-bf074f3f4174f31524d25da816cb4121a21da20c.tar.gz dexon-solidity-bf074f3f4174f31524d25da816cb4121a21da20c.tar.zst dexon-solidity-bf074f3f4174f31524d25da816cb4121a21da20c.zip |
Fix source index allocation in CompilerStack. Depending on compiler(optimisations) this could be off-by-one.
Diffstat (limited to 'libsolidity/interface')
-rw-r--r-- | libsolidity/interface/CompilerStack.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 92b49cda..6ea9ea78 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -406,8 +406,9 @@ vector<string> CompilerStack::sourceNames() const map<string, unsigned> CompilerStack::sourceIndices() const { map<string, unsigned> indices; + unsigned index = 0; for (auto const& s: m_sources) - indices[s.first] = indices.size(); + indices[s.first] = index++; return indices; } |