--verify: Fix false negative in itc test suite

This commit is contained in:
Daniel Marjamäki 2019-10-27 16:23:37 +01:00
parent c56a45840a
commit 83a7987f6f
1 changed files with 10 additions and 4 deletions

View File

@ -1020,8 +1020,11 @@ static ExprEngine::ValuePtr executeCast(const Token *tok, Data &data)
static ExprEngine::ValuePtr executeDot(const Token *tok, Data &data) static ExprEngine::ValuePtr executeDot(const Token *tok, Data &data)
{ {
if (!tok->astOperand1() || !tok->astOperand1()->varId()) if (!tok->astOperand1() || !tok->astOperand1()->varId()) {
return ExprEngine::ValuePtr(); auto v = getValueRangeFromValueType(data.getNewSymbolName(), tok->valueType(), *data.settings);
call(data.callbacks, tok, v, &data);
return v;
}
std::shared_ptr<ExprEngine::StructValue> structValue = std::dynamic_pointer_cast<ExprEngine::StructValue>(data.getValue(tok->astOperand1()->varId(), nullptr, nullptr)); std::shared_ptr<ExprEngine::StructValue> structValue = std::dynamic_pointer_cast<ExprEngine::StructValue>(data.getValue(tok->astOperand1()->varId(), nullptr, nullptr));
if (!structValue) { if (!structValue) {
if (tok->originalName() == "->") { if (tok->originalName() == "->") {
@ -1033,8 +1036,11 @@ static ExprEngine::ValuePtr executeDot(const Token *tok, Data &data)
call(data.callbacks, tok->astOperand1(), data.getValue(tok->astOperand1()->varId(), nullptr, nullptr), &data); call(data.callbacks, tok->astOperand1(), data.getValue(tok->astOperand1()->varId(), nullptr, nullptr), &data);
} }
} }
if (!structValue) if (!structValue) {
return ExprEngine::ValuePtr(); auto v = getValueRangeFromValueType(data.getNewSymbolName(), tok->valueType(), *data.settings);
call(data.callbacks, tok, v, &data);
return v;
}
} }
call(data.callbacks, tok->astOperand1(), structValue, &data); call(data.callbacks, tok->astOperand1(), structValue, &data);
return structValue->getValueOfMember(tok->astOperand2()->str()); return structValue->getValueOfMember(tok->astOperand2()->str());