Fix undefined behaviour while looking for lexical-binding file variable (bug 31186)

* src/lread.c (lisp_file_lexically_bound_p): Reset
beg_end_state before reading variable or value.
This commit is contained in:
Andreas Schwab 2018-04-17 11:36:36 +02:00
parent 4341aacd87
commit 3fa472b487

View file

@ -896,6 +896,7 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
ch = READCHAR;
i = 0;
beg_end_state = NOMINAL;
while (ch != ':' && ch != '\n' && ch != EOF && in_file_vars)
{
if (i < sizeof var - 1)
@ -921,6 +922,7 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
ch = READCHAR;
i = 0;
beg_end_state = NOMINAL;
while (ch != ';' && ch != '\n' && ch != EOF && in_file_vars)
{
if (i < sizeof val - 1)