| 1088 | } |
| 1089 | |
| 1090 | bool CheckUninitVarImpl::checkLoopBody(const Token *tok, const Variable& var, const Alloc alloc, const std::string &membervar, const bool suppressErrors) |
| 1091 | { |
| 1092 | bool bailout = false; |
| 1093 | bool alwaysReturns = false; |
| 1094 | const Token *errorToken = checkLoopBodyRecursive(tok, var, alloc, membervar, bailout, alwaysReturns); |
| 1095 | |
| 1096 | if (!suppressErrors && !bailout && !alwaysReturns && errorToken) { |
| 1097 | if (membervar.empty()) |
| 1098 | uninitvarError(errorToken, errorToken->expressionString(), alloc); |
| 1099 | else |
| 1100 | uninitStructMemberError(errorToken, errorToken->expressionString() + "." + membervar); |
| 1101 | return true; |
| 1102 | } |
| 1103 | |
| 1104 | return bailout || alwaysReturns; |
| 1105 | } |
| 1106 | |
| 1107 | void CheckUninitVarImpl::checkRhs(const Token *tok, const Variable &var, Alloc alloc, nonneg int number_of_if, const std::string &membervar) |
| 1108 | { |
nothing calls this directly
no test coverage detected