Throw internal error when tokens are not in order (#4623)
* Throw internal error when tokens are not in order * Add semicolon
This commit is contained in:
parent
7acbb656f3
commit
6eccb2e36c
|
@ -5331,6 +5331,8 @@ static void valueFlowForwardConst(Token* start,
|
||||||
const Settings* const settings,
|
const Settings* const settings,
|
||||||
int /*unused*/ = 0)
|
int /*unused*/ = 0)
|
||||||
{
|
{
|
||||||
|
if (!precedes(start, end))
|
||||||
|
throw InternalError(var->nameToken(), "valueFlowForwardConst: start token does not precede the end token.");
|
||||||
for (Token* tok = start; tok != end; tok = tok->next()) {
|
for (Token* tok = start; tok != end; tok = tok->next()) {
|
||||||
if (tok->varId() == var->declarationId()) {
|
if (tok->varId() == var->declarationId()) {
|
||||||
for (const ValueFlow::Value& value : values)
|
for (const ValueFlow::Value& value : values)
|
||||||
|
|
Loading…
Reference in New Issue