Fixed #4505 (test/testtokenize.cpp: Assertion failed in 'make check')

This commit is contained in:
Erik Lax 2013-01-23 18:27:28 +01:00 committed by Daniel Marjamäki
parent cecd726b11
commit 569b2ae9cd
1 changed files with 4 additions and 12 deletions

View File

@ -294,19 +294,11 @@ bool TokenList::createTokens(std::istream &code, const std::string& file0)
std::getline(code, line); std::getline(code, line);
// Update the current line number // Update the current line number
std::string::size_type n = 0; unsigned int row;
while (n < line.size() && std::isspace(line[n])) if (!(std::stringstream(line) >> row))
++n;
if (n == line.size())
++lineno; ++lineno;
else { else
while (n < line.size() && std::isdigit(line[n])) lineno = row;
++n;
if (n < line.size() && !std::isspace(line[n]))
++lineno;
else
std::istringstream(line) >> lineno;
}
CurrentToken.clear(); CurrentToken.clear();
continue; continue;
} else if (CurrentToken == "#endfile") { } else if (CurrentToken == "#endfile") {