Merge pull request #263 from gtsoul-tech/bug/cppcheck-61

Cppcheck knownConditionTrueFalse error
This commit is contained in:
Konstantinos Margaritis
2024-05-02 16:50:16 +03:00
committed by GitHub
10 changed files with 32 additions and 62 deletions

View File

@@ -1481,6 +1481,7 @@ u32 buildExceptionMap(const build_info &args, ReportListCache &reports_cache,
continue;
}
u32 j = args.state_ids.at(w);
// j can be NO_STATE if args.state_ids.at(w) returns NO_STATE
if (j == NO_STATE) {
continue;
}

View File

@@ -785,7 +785,7 @@ enum RepeatMatch repeatHasMatchRange(const struct RepeatInfo *info,
if (diff > info->repeatMax) {
DEBUG_PRINTF("range list is stale\n");
return REPEAT_STALE;
} else if (diff >= info->repeatMin && diff <= info->repeatMax) {
} else if (diff >= info->repeatMin) {
return REPEAT_MATCH;
}
@@ -836,7 +836,7 @@ enum RepeatMatch repeatHasMatchBitmap(const struct RepeatInfo *info,
if (diff > info->repeatMax) {
DEBUG_PRINTF("stale\n");
return REPEAT_STALE;
} else if (diff >= info->repeatMin && diff <= info->repeatMax) {
} else if (diff >= info->repeatMin) {
return REPEAT_MATCH;
}