aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2014-08-27 22:40:54 +0300
committerEli Zaretskii2014-08-27 22:40:54 +0300
commit9bac5fd91f5012a682be13e16561671f0f01c941 (patch)
tree4a5508bd086ad5ee758b3d636348741d5ae154f3 /src
parent110d87a1cc6a47e31ad9d70cc6366dd81d213860 (diff)
downloademacs-9bac5fd91f5012a682be13e16561671f0f01c941.tar.gz
emacs-9bac5fd91f5012a682be13e16561671f0f01c941.zip
Fix bug #18339 with segfault when $ is typed into empty LaTeX buffer.
src/syntax.c (scan_lists): Don't examine positions before BEGV.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/syntax.c11
2 files changed, 12 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 8a32bc27b0b..a7c8cb59a0f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12014-08-27 Eli Zaretskii <eliz@gnu.org>
2
3 * syntax.c (scan_lists): Don't examine positions before BEGV.
4 (Bug#18339)
5
12014-08-27 Paul Eggert <eggert@cs.ucla.edu> 62014-08-27 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 Improve robustness of new string-collation code (Bug#18051). 8 Improve robustness of new string-collation code (Bug#18051).
diff --git a/src/syntax.c b/src/syntax.c
index 4166ee211c7..df8800e90be 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -2857,10 +2857,13 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag)
2857 case Smath: 2857 case Smath:
2858 if (!sexpflag) 2858 if (!sexpflag)
2859 break; 2859 break;
2860 temp_pos = dec_bytepos (from_byte); 2860 if (from > BEGV)
2861 UPDATE_SYNTAX_TABLE_BACKWARD (from - 1); 2861 {
2862 if (from != stop && c == FETCH_CHAR_AS_MULTIBYTE (temp_pos)) 2862 temp_pos = dec_bytepos (from_byte);
2863 DEC_BOTH (from, from_byte); 2863 UPDATE_SYNTAX_TABLE_BACKWARD (from - 1);
2864 if (from != stop && c == FETCH_CHAR_AS_MULTIBYTE (temp_pos))
2865 DEC_BOTH (from, from_byte);
2866 }
2864 if (mathexit) 2867 if (mathexit)
2865 { 2868 {
2866 mathexit = 0; 2869 mathexit = 0;