aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-04-21 02:36:04 +0800
committerGitHub <noreply@github.com>2017-04-21 02:36:04 +0800
commit965de29772963b640b00579fa8225bb662599ecd (patch)
tree90ef7c763532016b288e4b357a3d533440878e0a
parent6468955fb1337f0f3d8eb4f35004d78179b8d7b8 (diff)
parentbf074f3f4174f31524d25da816cb4121a21da20c (diff)
downloaddexon-solidity-965de29772963b640b00579fa8225bb662599ecd.tar.gz
dexon-solidity-965de29772963b640b00579fa8225bb662599ecd.tar.zst
dexon-solidity-965de29772963b640b00579fa8225bb662599ecd.zip
Merge pull request #2143 from ethereum/ast-index-fix
Fix source index allocation in CompilerStack
-rw-r--r--Changelog.md5
-rw-r--r--libsolidity/interface/CompilerStack.cpp3
2 files changed, 6 insertions, 2 deletions
diff --git a/Changelog.md b/Changelog.md
index cd985917..dd62f2df 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -6,8 +6,11 @@ Features:
path(s) of the supplied source file(s) is always trusted.
Bugfixes:
- * Type system: Contract inheriting from base with unimplemented constructor should be abstract.
* Assembly output: Implement missing AssemblyItem types.
+ * Compiler interface: Fix a bug where source indexes could be inconsistent between Solidity compiled
+ with different compilers (clang vs. gcc) or compiler settings. The bug was visible in AST
+ and source mappings.
+ * Type system: Contract inheriting from base with unimplemented constructor should be abstract.
### 0.4.10 (2017-03-15)
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;
}