bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#24358: 25.1.50; re-search-forward errors with "Variable binding dept


From: Eli Zaretskii
Subject: bug#24358: 25.1.50; re-search-forward errors with "Variable binding depth exceeds max-specpdl-size"
Date: Thu, 13 Oct 2016 09:19:48 +0300

> From: address@hidden
> Cc: address@hidden,  address@hidden
> Date: Wed, 12 Oct 2016 21:29:34 -0400
> 
> > Anyway, the way to countermand this is to record in a local variable
> > the offset from beginning of buffer text to the value of the C pointer
> > before the call to record_xmalloc, then apply the offset after the
> > call to the new buffer text address.  (Let me know if this is clear
> > enough.)
> >
> > You can find an example of this in coding.c:decode_coding_emacs_mule
> > (search for "relocated" in that function).
> 
> This does involve passing down the lisp reference, right?  Just want to
> make sure I'm not missing something obvious before I start changing the
> interface on a bunch of functions.

Aren't we talking about searching buffer text in this case?  If so,
the start address of the buffer text is known globally, it is given by
current_buffer->text->beg.  You just need to calculate the difference
between the start address before and after the call to malloc, or to a
function that might call malloc.

Alternatively (and more safely), save the value of PTR_BYTE_POS before
the call to malloc, and restore the C text pointer after malloc with
BYTE_POS_ADDR.





reply via email to

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