Try to stop range overflow in forwardRange() (#4235)
* Try to stop range overflow in forwardRange() * Use predefinded function for check instead
This commit is contained in:
parent
0b63e7273d
commit
b246781da6
|
@ -85,7 +85,7 @@ PathAnalysis::Progress PathAnalysis::forwardRecursive(const Token* tok, Info inf
|
||||||
|
|
||||||
PathAnalysis::Progress PathAnalysis::forwardRange(const Token* startToken, const Token* endToken, Info info, const std::function<PathAnalysis::Progress(const Info&)>& f) const
|
PathAnalysis::Progress PathAnalysis::forwardRange(const Token* startToken, const Token* endToken, Info info, const std::function<PathAnalysis::Progress(const Info&)>& f) const
|
||||||
{
|
{
|
||||||
for (const Token *tok = startToken; tok && tok != endToken; tok = tok->next()) {
|
for (const Token *tok = startToken; precedes(tok, endToken); tok = tok->next()) {
|
||||||
if (Token::Match(tok, "asm|goto|break|continue"))
|
if (Token::Match(tok, "asm|goto|break|continue"))
|
||||||
return Progress::Break;
|
return Progress::Break;
|
||||||
else if (Token::Match(tok, "return|throw")) {
|
else if (Token::Match(tok, "return|throw")) {
|
||||||
|
|
Loading…
Reference in New Issue