mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-16 19:00:55 -08:00
Yet another fix for using pointers into buffer text
* src/search.c (boyer_moore): Update pointers to buffer text after call to set_search_regs. (Bug#24358)
This commit is contained in:
parent
1047496722
commit
96ac0c3ebc
1 changed files with 8 additions and 1 deletions
|
|
@ -2014,13 +2014,20 @@ boyer_moore (EMACS_INT n, unsigned char *base_pat,
|
|||
cursor += dirlen - i - direction; /* fix cursor */
|
||||
if (i + direction == 0)
|
||||
{
|
||||
ptrdiff_t position, start, end;
|
||||
ptrdiff_t position, start, end, cursor_off;
|
||||
|
||||
cursor -= direction;
|
||||
|
||||
position = pos_byte + cursor - p2 + ((direction > 0)
|
||||
? 1 - len_byte : 0);
|
||||
/* set_search_regs might call malloc, which could
|
||||
cause ralloc.c relocate buffer text. We need to
|
||||
update pointers into buffer text due to that. */
|
||||
cursor_off = cursor - p2;
|
||||
set_search_regs (position, len_byte);
|
||||
p_limit = BYTE_POS_ADDR (limit);
|
||||
p2 = BYTE_POS_ADDR (pos_byte);
|
||||
cursor = p2 + cursor_off;
|
||||
|
||||
if (NILP (Vinhibit_changing_match_data))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue