| 28 | } |
| 29 | |
| 30 | void ArrayAnalysisReport::add(ArgFlow &AF, std::vector<int> Indices) { |
| 31 | auto &A = AF.getLLVMArg(); |
| 32 | int Result = NO_ARRAY; |
| 33 | if (AF.isArray()) { |
| 34 | Result = ARRAY_NOLEN; |
| 35 | auto FI = AF.getFieldInfo(); |
| 36 | if (FI) { |
| 37 | if (FI->SizeFields.size() > 0) |
| 38 | Result = *FI->SizeFields.begin(); |
| 39 | } else if (AF.hasLenRelatedArg()) |
| 40 | Result = AF.getLenRelatedArgNo(); |
| 41 | } |
| 42 | set(A, Result, Indices); |
| 43 | |
| 44 | auto SI = AF.getStructInfo(); |
| 45 | if (!SI) |
| 46 | return; |
| 47 | |
| 48 | for (auto Iter : SI->FieldResults) { |
| 49 | if (!Iter.second) |
| 50 | continue; |
| 51 | |
| 52 | Indices.push_back(Iter.first); |
| 53 | add(*Iter.second, Indices); |
| 54 | Indices.pop_back(); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | } // namespace ftg |
nothing calls this directly
no test coverage detected