| 238 | } |
| 239 | |
| 240 | static void addToErrorPath(ValueFlow::Value& value, const std::vector<const ValueFlow::Value*>& refs) |
| 241 | { |
| 242 | std::unordered_set<const Token*> locations; |
| 243 | for (const ValueFlow::Value* ref : refs) { |
| 244 | if (ref->condition && !value.condition) |
| 245 | value.condition = ref->condition; |
| 246 | std::copy_if(ref->errorPath.cbegin(), |
| 247 | ref->errorPath.cend(), |
| 248 | std::back_inserter(value.errorPath), |
| 249 | [&](const ErrorPathItem& e) { |
| 250 | return locations.insert(e.first).second; |
| 251 | }); |
| 252 | std::copy_if(ref->debugPath.cbegin(), |
| 253 | ref->debugPath.cend(), |
| 254 | std::back_inserter(value.debugPath), |
| 255 | [&](const ErrorPathItem& e) { |
| 256 | return locations.insert(e.first).second; |
| 257 | }); |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | static void setValueKind(ValueFlow::Value& value, const std::vector<const ValueFlow::Value*>& refs) |
| 262 | { |