diff options
| author | Andreas Schwab | 2018-04-17 11:36:36 +0200 |
|---|---|---|
| committer | Andreas Schwab | 2018-04-17 11:43:14 +0200 |
| commit | 3fa472b4873b395e6f9400884ee22b66c0a86966 (patch) | |
| tree | 2e753d77b14bdbc35f14b3beaa3b3a53d6321de7 /src | |
| parent | 4341aacd87912e7ba2c781fef9f1ff73d1a5bf0a (diff) | |
| download | emacs-3fa472b4873b395e6f9400884ee22b66c0a86966.tar.gz emacs-3fa472b4873b395e6f9400884ee22b66c0a86966.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lread.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lread.c b/src/lread.c index 3104c441ecf..72523c057f1 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -896,6 +896,7 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun) | |||
| 896 | ch = READCHAR; | 896 | ch = READCHAR; |
| 897 | 897 | ||
| 898 | i = 0; | 898 | i = 0; |
| 899 | beg_end_state = NOMINAL; | ||
| 899 | while (ch != ':' && ch != '\n' && ch != EOF && in_file_vars) | 900 | while (ch != ':' && ch != '\n' && ch != EOF && in_file_vars) |
| 900 | { | 901 | { |
| 901 | if (i < sizeof var - 1) | 902 | if (i < sizeof var - 1) |
| @@ -921,6 +922,7 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun) | |||
| 921 | ch = READCHAR; | 922 | ch = READCHAR; |
| 922 | 923 | ||
| 923 | i = 0; | 924 | i = 0; |
| 925 | beg_end_state = NOMINAL; | ||
| 924 | while (ch != ';' && ch != '\n' && ch != EOF && in_file_vars) | 926 | while (ch != ';' && ch != '\n' && ch != EOF && in_file_vars) |
| 925 | { | 927 | { |
| 926 | if (i < sizeof val - 1) | 928 | if (i < sizeof val - 1) |