#6948 cash: daca: mgetty (garbage code)
This commit is contained in:
parent
8d926d7328
commit
873861df4a
|
@ -1970,7 +1970,7 @@ void Tokenizer::concatenateNegativeNumberAndAnyPositive()
|
|||
if (!Token::Match(tok, "?|:|,|(|[|{|return|case|sizeof|%op% +|-") || tok->tokType() == Token::eIncDecOp)
|
||||
continue;
|
||||
|
||||
while (tok->next()->str() == "+")
|
||||
while (tok->next() && tok->next()->str() == "+")
|
||||
tok->deleteNext();
|
||||
|
||||
if (Token::Match(tok->next(), "- %num%")) {
|
||||
|
|
|
@ -163,6 +163,7 @@ private:
|
|||
TEST_CASE(garbageCode121); // #2585
|
||||
TEST_CASE(garbageCode122); // #6303
|
||||
TEST_CASE(garbageCode123);
|
||||
TEST_CASE(garbageCode124); // 6948
|
||||
|
||||
TEST_CASE(garbageValueFlow);
|
||||
TEST_CASE(garbageSymbolDatabase);
|
||||
|
@ -933,6 +934,10 @@ private:
|
|||
"}");
|
||||
}
|
||||
|
||||
void garbageCode124() {
|
||||
checkCode("+---+");
|
||||
}
|
||||
|
||||
void garbageValueFlow() {
|
||||
// #6089
|
||||
const char* code = "{} int foo(struct, x1, struct x2, x3, int, x5, x6, x7)\n"
|
||||
|
|
Loading…
Reference in New Issue