emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-25 ee04aed: Fix handling of buffer relocation in reg


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-25 ee04aed: Fix handling of buffer relocation in regex.c functions
Date: Sun, 23 Oct 2016 19:10:28 +0000 (UTC)

branch: emacs-25
commit ee04aedc723b035eedaf975422d4eb242894121b
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix handling of buffer relocation in regex.c functions
    
    * src/search.c (search_buffer): Updated the base pointer to buffer
    text after the call to re_search_2.  (Bug#24358)
---
 src/search.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/search.c b/src/search.c
index ec5a1d7..5c04916 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1233,6 +1233,8 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, 
ptrdiff_t pos_byte,
                              ? &search_regs : &search_regs_1),
                             /* Don't allow match past current point */
                             pos_byte - BEGV_BYTE);
+         /* Update 'base' due to possible relocation inside re_search_2.  */
+         base = current_buffer->text->beg;
          if (val == -2)
            {
              matcher_overflow ();
@@ -1279,6 +1281,8 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, 
ptrdiff_t pos_byte,
                             (NILP (Vinhibit_changing_match_data)
                              ? &search_regs : &search_regs_1),
                             lim_byte - BEGV_BYTE);
+         /* Update 'base' due to possible relocation inside re_search_2.  */
+         base = current_buffer->text->beg;
          if (val == -2)
            {
              matcher_overflow ();



reply via email to

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