summaryrefslogtreecommitdiffhomepage
path: root/lexer.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-04-29 17:52:18 +0200
committerJo-Philipp Wich <jo@mein.io>2021-04-29 17:52:18 +0200
commit2bc9bace716fafa408dfc6683ca3ff0f9d8bc44b (patch)
tree0f0e3480be9e72deac5b36ed8b93142d816b426f /lexer.c
parentf73e20158641a96882565852d0e2a6bf1540d950 (diff)
lexer: fix infinite loop on parsing unterminated expression blocks
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lexer.c')
-rw-r--r--lexer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lexer.c b/lexer.c
index 6e1dcd9..616f484 100644
--- a/lexer.c
+++ b/lexer.c
@@ -1107,6 +1107,8 @@ lex_step(uc_lexer *lex, FILE *fp)
}
/* premature EOF */
+ lex->state = UT_LEX_EOF;
+
return emit_op(lex, lex->source->off, TK_ERROR, ucv_string_new("Unterminated template block"));