Skip to content

Commit

Permalink
Fix name indexing issues (JuliaLang#49070)
Browse files Browse the repository at this point in the history
  • Loading branch information
pchintalapudi authored and Xnartharax committed Apr 13, 2023
1 parent b06cef8 commit a9c32da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/aotcompile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ static void add_output(Module &M, TargetMachine &TM, std::vector<std::string> &o
}
}
for (unsigned i = 0; i < threads; ++i) {
auto start = &outputs[outputs.size() - outcount * threads * 2 + i];
auto start = &outputs[outputs.size() - outcount * threads * 2 + i * outcount];
auto istr = std::to_string(i);
if (unopt_out)
*start++ = (name + "_unopt#" + istr + ".bc").str();
Expand All @@ -1274,7 +1274,7 @@ static void add_output(Module &M, TargetMachine &TM, std::vector<std::string> &o
if (threads == 1) {
output_timer.startTimer();
SmallVector<StringRef, 4> names;
for (unsigned i = 0; i < outcount; ++i)
for (unsigned i = outputs.size() - outcount * 2; i < outputs.size() - outcount; ++i)
names.push_back(outputs[i]);
add_output_impl(M, TM, outputs.data() + outputs.size() - outcount, names.data(),
unopt_out ? unopt.data() + unopt.size() - 1 : nullptr,
Expand Down

0 comments on commit a9c32da

Please sign in to comment.