| 854 | } |
| 855 | |
| 856 | const Token* CheckUninitVarImpl::checkExpr(const Token* tok, const Variable& var, const Alloc alloc, bool known, bool* bailout) const |
| 857 | { |
| 858 | if (!tok) |
| 859 | return nullptr; |
| 860 | if (isUnevaluated(tok->previous())) |
| 861 | return nullptr; |
| 862 | |
| 863 | if (tok->astOperand1()) { |
| 864 | bool bailout1 = false; |
| 865 | const Token *errorToken = checkExpr(tok->astOperand1(), var, alloc, known, &bailout1); |
| 866 | if (bailout && bailout1) |
| 867 | *bailout = true; |
| 868 | if (errorToken) |
| 869 | return errorToken; |
| 870 | if ((bailout1 || !known) && Token::Match(tok, "%oror%|&&|?")) |
| 871 | return nullptr; |
| 872 | } |
| 873 | if (tok->astOperand2()) |
| 874 | return checkExpr(tok->astOperand2(), var, alloc, known, bailout); |
| 875 | if (tok->varId() == var.declarationId()) { |
| 876 | const Token *errorToken = isVariableUsage(tok, var.isPointer(), alloc); |
| 877 | if (errorToken) |
| 878 | return errorToken; |
| 879 | if (bailout) |
| 880 | *bailout = true; |
| 881 | } |
| 882 | return nullptr; |
| 883 | } |
| 884 | |
| 885 | bool CheckUninitVarImpl::checkIfForWhileHead(const Token *startparentheses, const Variable& var, bool suppressErrors, bool isuninit, Alloc alloc, const std::string &membervar) |
| 886 | { |
nothing calls this directly
no test coverage detected