| 368 | } |
| 369 | |
| 370 | static std::string stringifyIndexes(const std::string& array, const std::vector<ValueFlow::Value>& indexValues) |
| 371 | { |
| 372 | if (indexValues.size() == 1) |
| 373 | return MathLib::toString(indexValues[0].intvalue); |
| 374 | |
| 375 | std::ostringstream ret; |
| 376 | ret << array; |
| 377 | for (const ValueFlow::Value& index : indexValues) { |
| 378 | ret << "["; |
| 379 | if (index.isNonValue()) |
| 380 | ret << "*"; |
| 381 | else |
| 382 | ret << index.intvalue; |
| 383 | ret << "]"; |
| 384 | } |
| 385 | return ret.str(); |
| 386 | } |
| 387 | |
| 388 | static std::string arrayIndexMessage(const Token* tok, |
| 389 | const std::vector<Dimension>& dimensions, |
no test coverage detected