mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 02:32:06 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user