ExprEngine: Throw exception if there is unhandled expression in assignment LHS

This commit is contained in:
Daniel Marjamäki 2019-10-22 18:39:15 +02:00
parent 3e4dd9b354
commit 3699227b12
1 changed files with 3 additions and 0 deletions

View File

@ -877,6 +877,9 @@ static ExprEngine::ValuePtr executeAssign(const Token *tok, Data &data)
assignValue = simplifyValue(std::make_shared<ExprEngine::BinOpResult>(binop, lhsValue, rhsValue));
}
if (!assignValue)
throw VerifyException(tok, "Expression '" + tok->expressionString() + "'; No value for LHS!");
const Token *lhsToken = tok->astOperand1();
assignValue = truncateValue(assignValue, lhsToken->valueType(), data);
call(data.callbacks, tok, assignValue, &data);