Fix source index allocation in CompilerStack. Depending on compiler(optimisations) this could be off-by-one.

This commit is contained in:
Alex Beregszaszi committed 2017-04-20 19:20:14 +01:00
1 parent 6468955fb1
commit bf074f3f41
2 files changed
+6 -2

No files matched your search

+2 -1
View File
@@ -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;
}