aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/lexer.l
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-05-25 15:45:10 +0200
committerEelco Dolstra <edolstra@gmail.com>2022-05-25 17:58:13 +0200
commit27ebb97d0a51a3198f2c95cbdccd6f56274c19ee (patch)
tree237252b4ada96e9739362719939fe641e4710589 /src/libexpr/lexer.l
parentd8398d33c9a09e1f5599127ae6d477e7e0868b55 (diff)
Handle EOFs in string literals correctly
We can't return a STR token without setting a valid StringToken, otherwise the parser will crash. Fixes #6562.
Diffstat (limited to 'src/libexpr/lexer.l')
-rw-r--r--src/libexpr/lexer.l2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l
index 4c28b976e..462b3b602 100644
--- a/src/libexpr/lexer.l
+++ b/src/libexpr/lexer.l
@@ -198,7 +198,7 @@ or { return OR_KW; }
(...|\$[^\{\"\\]|\\.|\$\\.)+ would have triggered.
This is technically invalid, but we leave the problem to the
parser who fails with exact location. */
- return STR;
+ return EOF;
}
\'\'(\ *\n)? { PUSH_STATE(IND_STRING); return IND_STRING_OPEN; }