#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)
|
if (!Token::Match(tok, "?|:|,|(|[|{|return|case|sizeof|%op% +|-") || tok->tokType() == Token::eIncDecOp)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
while (tok->next()->str() == "+")
|
while (tok->next() && tok->next()->str() == "+")
|
||||||
tok->deleteNext();
|
tok->deleteNext();
|
||||||
|
|
||||||
if (Token::Match(tok->next(), "- %num%")) {
|
if (Token::Match(tok->next(), "- %num%")) {
|
||||||
|
|
|
@ -163,6 +163,7 @@ private:
|
||||||
TEST_CASE(garbageCode121); // #2585
|
TEST_CASE(garbageCode121); // #2585
|
||||||
TEST_CASE(garbageCode122); // #6303
|
TEST_CASE(garbageCode122); // #6303
|
||||||
TEST_CASE(garbageCode123);
|
TEST_CASE(garbageCode123);
|
||||||
|
TEST_CASE(garbageCode124); // 6948
|
||||||
|
|
||||||
TEST_CASE(garbageValueFlow);
|
TEST_CASE(garbageValueFlow);
|
||||||
TEST_CASE(garbageSymbolDatabase);
|
TEST_CASE(garbageSymbolDatabase);
|
||||||
|
@ -933,6 +934,10 @@ private:
|
||||||
"}");
|
"}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void garbageCode124() {
|
||||||
|
checkCode("+---+");
|
||||||
|
}
|
||||||
|
|
||||||
void garbageValueFlow() {
|
void garbageValueFlow() {
|
||||||
// #6089
|
// #6089
|
||||||
const char* code = "{} int foo(struct, x1, struct x2, x3, int, x5, x6, x7)\n"
|
const char* code = "{} int foo(struct, x1, struct x2, x3, int, x5, x6, x7)\n"
|
||||||
|
|
Loading…
Reference in New Issue