Fixed #2875
This commit is contained in:
parent
a4c4c66a4c
commit
1e708e10d0
|
@ -7783,7 +7783,10 @@ void Tokenizer::simplifyComma()
|
||||||
|
|
||||||
// Skip unhandled template specifiers..
|
// Skip unhandled template specifiers..
|
||||||
if (Token::Match(tok, "%var% <")) {
|
if (Token::Match(tok, "%var% <")) {
|
||||||
tok->next()->findClosingBracket(tok);
|
Token* tok2;
|
||||||
|
tok->next()->findClosingBracket(tok2);
|
||||||
|
if (tok2)
|
||||||
|
tok = tok2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If token after the comma is a constant number, simplification is not required.
|
// If token after the comma is a constant number, simplification is not required.
|
||||||
|
|
|
@ -3064,7 +3064,7 @@ private:
|
||||||
|
|
||||||
void varid33() { // ticket #2875 (segmentation fault)
|
void varid33() { // ticket #2875 (segmentation fault)
|
||||||
const std::string code("0; (a) < (a)");
|
const std::string code("0; (a) < (a)");
|
||||||
tokenizeDebugListing(code);
|
tokenizeDebugListing(code, true);
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue