Fixed #4505 (test/testtokenize.cpp: Assertion failed in 'make check')
This commit is contained in:
parent
cecd726b11
commit
569b2ae9cd
|
@ -294,19 +294,11 @@ bool TokenList::createTokens(std::istream &code, const std::string& file0)
|
|||
std::getline(code, line);
|
||||
|
||||
// Update the current line number
|
||||
std::string::size_type n = 0;
|
||||
while (n < line.size() && std::isspace(line[n]))
|
||||
++n;
|
||||
if (n == line.size())
|
||||
++lineno;
|
||||
else {
|
||||
while (n < line.size() && std::isdigit(line[n]))
|
||||
++n;
|
||||
if (n < line.size() && !std::isspace(line[n]))
|
||||
unsigned int row;
|
||||
if (!(std::stringstream(line) >> row))
|
||||
++lineno;
|
||||
else
|
||||
std::istringstream(line) >> lineno;
|
||||
}
|
||||
lineno = row;
|
||||
CurrentToken.clear();
|
||||
continue;
|
||||
} else if (CurrentToken == "#endfile") {
|
||||
|
|
Loading…
Reference in New Issue