Fix condition for assuming at EOF

Part of that condition's purpose is to ensure that we read the correct
lexer state; but it's possible now for the fstack to be non-empty
*before* the lexer state is registered, i.e. if there is an error
in the function that registers it.
This causes a NULL pointer deref.
This commit is contained in:
ISSOtm committed 2024-09-05 17:48:52 +02:00
1 parent e289387b09
commit 610f04beeb
7 files changed
+19 -5

No files matched your search

+1 -1
View File
@@ -73,7 +73,7 @@ std::string const &FileStackNode::dump(uint32_t curLineNo) const {
}
void fstk_DumpCurrent() {
if (contextStack.empty()) {
if (lexer_AtTopLevel()) {
fputs("at top level", stderr);
return;
}