emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r117463: Fix bug #18339 with segfault when $ is t


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-24 r117463: Fix bug #18339 with segfault when $ is typed into empty LaTeX buffer.
Date: Thu, 28 Aug 2014 16:27:24 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117463
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/18339
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-24
timestamp: Thu 2014-08-28 19:26:39 +0300
message:
  Fix bug #18339 with segfault when $ is typed into empty LaTeX buffer.
  Back-ported from trunk revision-id: address@hidden
  
   src/syntax.c (scan_lists): Don't examine positions before BEGV.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/syntax.c                   syntax.c-20091113204419-o5vbwnq5f7feedwu-180
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-08-25 17:44:27 +0000
+++ b/src/ChangeLog     2014-08-28 16:26:39 +0000
@@ -1,3 +1,8 @@
+2014-08-28  Eli Zaretskii  <address@hidden>
+
+       * syntax.c (scan_lists): Don't examine positions before BEGV.
+       (Bug#18339)
+
 2014-08-25  Eli Zaretskii  <address@hidden>
 
        * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Don't define.

=== modified file 'src/syntax.c'
--- a/src/syntax.c      2014-07-05 02:17:14 +0000
+++ b/src/syntax.c      2014-08-28 16:26:39 +0000
@@ -2859,10 +2859,13 @@
            case Smath:
              if (!sexpflag)
                break;
-             temp_pos = dec_bytepos (from_byte);
-             UPDATE_SYNTAX_TABLE_BACKWARD (from - 1);
-             if (from != stop && c == FETCH_CHAR_AS_MULTIBYTE (temp_pos))
-               DEC_BOTH (from, from_byte);
+             if (from > BEGV)
+               {
+                 temp_pos = dec_bytepos (from_byte);
+                 UPDATE_SYNTAX_TABLE_BACKWARD (from - 1);
+                 if (from != stop && c == FETCH_CHAR_AS_MULTIBYTE (temp_pos))
+                   DEC_BOTH (from, from_byte);
+               }
              if (mathexit)
                {
                  mathexit = 0;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]