#6276 clang: -fsanitize=integer warnings. Fix unwanted integer overflow in TemplateSimplifier::useDefaultArgumentValues() and Tokenizer::simplifyQtSignalsSlots()
This commit is contained in:
parent
71cb8e9f64
commit
6f96634759
|
@ -569,9 +569,10 @@ void TemplateSimplifier::useDefaultArgumentValues(const std::list<Token *> &temp
|
||||||
if (tok->str() == ">") {
|
if (tok->str() == ">") {
|
||||||
if (Token::Match(tok, "> class|struct %name%"))
|
if (Token::Match(tok, "> class|struct %name%"))
|
||||||
classname = tok->strAt(2);
|
classname = tok->strAt(2);
|
||||||
--templateParmDepth;
|
if (templateParmDepth<2)
|
||||||
if (0 == templateParmDepth)
|
|
||||||
break;
|
break;
|
||||||
|
else
|
||||||
|
--templateParmDepth;
|
||||||
}
|
}
|
||||||
|
|
||||||
// next template parameter
|
// next template parameter
|
||||||
|
@ -601,7 +602,7 @@ void TemplateSimplifier::useDefaultArgumentValues(const std::list<Token *> &temp
|
||||||
|
|
||||||
// count the parameters..
|
// count the parameters..
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
unsigned int usedpar = TemplateSimplifier::templateParameters(tok);
|
const unsigned int usedpar = TemplateSimplifier::templateParameters(tok);
|
||||||
tok = tok->findClosingBracket();
|
tok = tok->findClosingBracket();
|
||||||
|
|
||||||
if (tok && tok->str() == ">") {
|
if (tok && tok->str() == ">") {
|
||||||
|
|
|
@ -9860,9 +9860,10 @@ void Tokenizer::simplifyQtSignalsSlots()
|
||||||
else
|
else
|
||||||
tok2 = tok2->link();
|
tok2 = tok2->link();
|
||||||
} else if (tok2->str() == "}") {
|
} else if (tok2->str() == "}") {
|
||||||
--indentlevel;
|
if (indentlevel<2)
|
||||||
if (indentlevel == 0)
|
|
||||||
break;
|
break;
|
||||||
|
else
|
||||||
|
--indentlevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tok2->strAt(1) == "Q_OBJECT") {
|
if (tok2->strAt(1) == "Q_OBJECT") {
|
||||||
|
|
Loading…
Reference in New Issue