From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24358: 25.1.50; re-search-forward errors with "Variable binding depth exceeds max-specpdl-size" Date: Thu, 20 Oct 2016 11:39:54 +0300 Message-ID: <83oa2ftnvp.fsf@gnu.org> References: <87twe6sx2g.fsf@users.sourceforge.net> <87eg51ng4r.fsf_-_@users.sourceforge.net> <87k2djwumn.fsf@users.sourceforge.net> <83h98nidvd.fsf@gnu.org> <87eg3rvtsf.fsf@users.sourceforge.net> <83k2dihpm9.fsf@gnu.org> <8760p2wzgj.fsf@users.sourceforge.net> <838ttyhhzu.fsf@gnu.org> <871szqwu51.fsf@users.sourceforge.net> <831szqhbc2.fsf@gnu.org> <87h98hujcx.fsf@users.sourceforge.net> <831szkahyz.fsf@gnu.org> <87eg3jvfj6.fsf@users.sourceforge.net> <8360ov8lbu.fsf@gnu.org> <877f95uj66.fsf@users.sourceforge.net> <83zim0vn1t.fsf@gnu.org> <874m48v7wj.fsf@users.sourceforge.net> <83insov1zr.fsf@gnu.org> <87zilztzd5.fsf@users.sourceforge.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1476952892 2025 195.159.176.226 (20 Oct 2016 08:41:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 20 Oct 2016 08:41:32 +0000 (UTC) Cc: sam.halliday@gmail.com, 24358@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 20 10:41:28 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bx8uX-0006kv-Ol for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Oct 2016 10:41:13 +0200 Original-Received: from localhost ([::1]:53219 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bx8uZ-0002NL-W6 for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Oct 2016 04:41:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bx8uP-0002LA-JP for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2016 04:41:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bx8uM-0002Bh-Uv for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2016 04:41:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34136) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bx8uM-0002BX-RE for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2016 04:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bx8uM-0002fP-GA for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2016 04:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Oct 2016 08:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24358 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 24358-submit@debbugs.gnu.org id=B24358.147695282110194 (code B ref 24358); Thu, 20 Oct 2016 08:41:02 +0000 Original-Received: (at 24358) by debbugs.gnu.org; 20 Oct 2016 08:40:21 +0000 Original-Received: from localhost ([127.0.0.1]:40326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bx8th-0002eM-17 for submit@debbugs.gnu.org; Thu, 20 Oct 2016 04:40:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53763) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bx8tf-0002e7-Di for 24358@debbugs.gnu.org; Thu, 20 Oct 2016 04:40:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bx8tX-0001q3-Cp for 24358@debbugs.gnu.org; Thu, 20 Oct 2016 04:40:14 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41204) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bx8tT-0001nj-VK; Thu, 20 Oct 2016 04:40:07 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4785 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bx8tT-0001C1-6P; Thu, 20 Oct 2016 04:40:07 -0400 In-reply-to: <87zilztzd5.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:124721 Archived-At: > From: npostavs@users.sourceforge.net > Cc: 24358@debbugs.gnu.org, sam.halliday@gmail.com > Date: Thu, 20 Oct 2016 00:31:50 -0400 > > Eli Zaretskii writes: > > > >> +#ifdef emacs > >> +#define STR_BASE_PTR(obj) \ > >> + (BUFFERP (obj)? XBUFFER (obj)->text->beg : \ > >> + STRINGP (obj)? SDATA (obj) : \ > >> + NULL) > > > > [...] > > > the only test in the macro should be STRINGP. > > Hmm, not sure I feel comfortable being that implicit. I kept this macro > the same except for using (NILP (obj)? current_buffer->...) instead of > BUFFERP and XBUFFER. Fine with me. > Here is the new patch: LGTM, a few minor comments below. > +#ifdef emacs > +#define STR_BASE_PTR(obj) \ > + (NILP(obj)? current_buffer->text->beg : \ ^ Please leave a blank before the left parenthesis where indicated. Also, another blank between the right parenthesis and the following question mark. > + STRINGP (obj)? SDATA (obj) : \ Likewise here. > diff --git a/src/regex.h b/src/regex.h > index 51f4424..d5c9690 100644 > --- a/src/regex.h > +++ b/src/regex.h > @@ -169,7 +169,8 @@ extern reg_syntax_t re_syntax_options; > #ifdef emacs > # include "lisp.h" > /* In Emacs, this is the string or buffer in which we are matching. > - It is used for looking up syntax properties. > + It is used for looking up syntax properties, and also to recompute > + pointers in case the object is relocated by GC. Not "by GC", but "as a side effect of calling malloc". Maybe it's a good idea to also mention ralloc.c here. > + /* Get pointers and sizes of the two strings that make up the > + visible portion of the buffer. Note that we can use pointers > + here, unlike in search_buffer, because we only call re_match_2 > + once. */ I'm not sure the reader will understand the significance of calling re_match_2 only once. It would be good to clarify the comment. Otherwise, I think this should go in. Thanks!