Fix Cppcheck warning

This commit is contained in:
Daniel Marjamäki 2020-12-13 16:47:50 +01:00
parent be4de06a97
commit 8f71e62fd6
1 changed files with 1 additions and 1 deletions

View File

@ -2628,7 +2628,7 @@ static std::string execute(const Token *start, const Token *end, Data &data)
if (!structVal) { if (!structVal) {
// Handle pointer to a struct // Handle pointer to a struct
if (auto structPtr = std::dynamic_pointer_cast<ExprEngine::ArrayValue>(structVal1)) { if (auto structPtr = std::dynamic_pointer_cast<ExprEngine::ArrayValue>(structVal1)) {
if (structPtr && structPtr->pointer && !structPtr->data.empty()) { if (structPtr->pointer && !structPtr->data.empty()) {
auto indexValue = std::make_shared<ExprEngine::IntRange>("0", 0, 0); auto indexValue = std::make_shared<ExprEngine::IntRange>("0", 0, 0);
for (auto val: structPtr->read(indexValue)) { for (auto val: structPtr->read(indexValue)) {
structVal = std::dynamic_pointer_cast<ExprEngine::StructValue>(val.second); structVal = std::dynamic_pointer_cast<ExprEngine::StructValue>(val.second);