diff --git a/src/scanner.cc b/src/scanner.cc index 196153e..31feb38 100644 --- a/src/scanner.cc +++ b/src/scanner.cc @@ -202,8 +202,10 @@ struct Scanner { lexer->advance(lexer, false); if (lexer->lookahead == '>') { lexer->advance(lexer, false); - tags.pop_back(); - lexer->result_symbol = SELF_CLOSING_TAG_DELIMITER; + if (!tags.empty()) { + tags.pop_back(); + lexer->result_symbol = SELF_CLOSING_TAG_DELIMITER; + } return true; } return false;