Bug hunting; Fix FP for struct with uninitialized members passed to function in C
This commit is contained in:
parent
c7a8f5217f
commit
bcaf792e30
|
@ -250,6 +250,8 @@ static void uninit(const Token *tok, const ExprEngine::Value &value, ExprEngine:
|
|||
return;
|
||||
if (uninitData && argvar && !argvar->isConst())
|
||||
return;
|
||||
if (!uninitStructMember.empty() && dataBase->isC() && argvar && !argvar->isConst())
|
||||
return;
|
||||
} else if (uninitData) {
|
||||
if (dataBase->settings->library.getFunction(parent->astOperand1()))
|
||||
return;
|
||||
|
|
|
@ -371,6 +371,9 @@ namespace {
|
|||
int recursion;
|
||||
std::time_t startTime;
|
||||
|
||||
bool isC() const OVERRIDE { return tokenizer->isC(); }
|
||||
bool isCPP() const OVERRIDE { return tokenizer->isCPP(); }
|
||||
|
||||
ExprEngine::ValuePtr executeContract(const Function *function, ExprEngine::ValuePtr(*executeExpression)(const Token*, Data&)) {
|
||||
const auto it = settings->functionContracts.find(function->fullName());
|
||||
if (it == settings->functionContracts.end())
|
||||
|
|
|
@ -79,6 +79,8 @@ namespace ExprEngine {
|
|||
virtual std::string getNewSymbolName() = 0;
|
||||
const std::string currentFunction;
|
||||
const Settings * const settings;
|
||||
virtual bool isC() const = 0;
|
||||
virtual bool isCPP() const = 0;
|
||||
virtual void reportError(const Token *tok,
|
||||
Severity::SeverityType severity,
|
||||
const char id[],
|
||||
|
|
|
@ -36,8 +36,6 @@ def get_error_lines(filename):
|
|||
if testfile.find('uninit_') >= 0:
|
||||
if linenr == 177:
|
||||
linenr = 176
|
||||
elif linenr == 200:
|
||||
linenr = 225 # warn about function call
|
||||
elif linenr == 241:
|
||||
linenr = 242 # warn about usage
|
||||
elif linenr == 266:
|
||||
|
|
Loading…
Reference in New Issue