Skip to content

Commit

Permalink
Put a constant 0 in empty iterator lists #20
Browse files Browse the repository at this point in the history
  • Loading branch information
riftEmber committed Sep 10, 2021
1 parent d538616 commit d8988b1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/StmtContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,15 @@ std::string StmtContext::exprToStringWithSafeArrays(Expr *expr) {
std::string StmtContext::getItersTupleString() {
std::ostringstream os;
os << "[";
for (const auto &it: iterators) {
if (it != *iterators.begin()) {
os << ",";
if (iterators.empty()) {
os << "0";
} else {
for (const auto &it: iterators) {
if (it != *iterators.begin()) {
os << ",";
}
os << it;
}
os << it;
}
os << "]";
return os.str();
Expand Down

0 comments on commit d8988b1

Please sign in to comment.