7111 segmentation fault (invalid code) in Tokenizer::simplifyRedundantParentheses
This commit is contained in:
parent
4ea9655685
commit
ab296fa93f
|
@ -6897,7 +6897,7 @@ bool Tokenizer::simplifyRedundantParentheses()
|
|||
}
|
||||
|
||||
while (Token::simpleMatch(tok, "( (") &&
|
||||
tok->link()->previous() == tok->next()->link()) {
|
||||
tok->link() && tok->link()->previous() == tok->next()->link()) {
|
||||
// We have "(( *something* ))", remove the inner
|
||||
// parentheses
|
||||
tok->deleteNext();
|
||||
|
|
|
@ -201,6 +201,7 @@ private:
|
|||
TEST_CASE(garbageCode150); // #7089
|
||||
TEST_CASE(garbageCode151); // #4175
|
||||
TEST_CASE(garbageCode152); // travis after 9c7271a5
|
||||
TEST_CASE(garbageCode153);
|
||||
|
||||
|
||||
TEST_CASE(garbageValueFlow);
|
||||
|
@ -1213,6 +1214,10 @@ private:
|
|||
checkCode(code);
|
||||
}
|
||||
|
||||
void garbageCode153() {
|
||||
ASSERT_THROW(checkCode("enum { X = << { X } } { X X } enum { X = << { ( X ) } } { } X */"), InternalError);
|
||||
}
|
||||
|
||||
void garbageValueFlow() {
|
||||
// #6089
|
||||
const char* code = "{} int foo(struct, x1, struct x2, x3, int, x5, x6, x7)\n"
|
||||
|
|
Loading…
Reference in New Issue