tokenizer: Added guard in case the preprocessor is mismatching
This commit is contained in:
parent
fa070ac73c
commit
0b95fdafb7
|
@ -309,6 +309,12 @@ void Tokenizer::tokenize(std::istream &code, const char FileName[])
|
||||||
|
|
||||||
else if (strncmp(line.c_str(), "#endfile", 8) == 0)
|
else if (strncmp(line.c_str(), "#endfile", 8) == 0)
|
||||||
{
|
{
|
||||||
|
if ( lineNumbers.empty() || fileIndexes.empty() )
|
||||||
|
{
|
||||||
|
std::cerr << "####### Preprocessor bug! #######\n";
|
||||||
|
std::exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
lineno = lineNumbers.back();
|
lineno = lineNumbers.back();
|
||||||
lineNumbers.pop_back();
|
lineNumbers.pop_back();
|
||||||
FileIndex = fileIndexes.back();
|
FileIndex = fileIndexes.back();
|
||||||
|
|
Loading…
Reference in New Issue