Fixed crash on garbage code #6106
This commit is contained in:
parent
9733a751ec
commit
78932094c8
|
@ -1413,6 +1413,8 @@ static void valueFlowForLoop(TokenList *tokenlist, ErrorLogger *errorLogger, con
|
|||
continue;
|
||||
|
||||
Token * const bodyStart = tok->linkAt(1)->next();
|
||||
if (!bodyStart->link() || bodyStart->str() != "{")
|
||||
continue;
|
||||
|
||||
unsigned int varid(0);
|
||||
MathLib::bigint num1(0), num2(0), numAfter(0);
|
||||
|
|
|
@ -1263,6 +1263,10 @@ private:
|
|||
" (foo(s, , 2, , , 5, , 7)) abort()\n"
|
||||
"}\n";
|
||||
ASSERT_THROW(valueOfTok(code, "*"), InternalError);
|
||||
|
||||
// #6106
|
||||
code = " f { int i ; b2 , [ ] ( for ( i = 0 ; ; ) ) }";
|
||||
valueOfTok(code, "*");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue