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

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

Re: re-search-forward ... nil t) results in error instead of returning n


From: Stefan Monnier
Subject: Re: re-search-forward ... nil t) results in error instead of returning nil
Date: Sat, 20 Nov 2004 19:40:39 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

> (re-search-forward "\"\\(?:[^\\\"]\\|\\\\\\(?:.\\|[\n]\\)\\)*\"\\|`[^']+'"
[...]
> Debugger entered--Lisp error: (error "Stack overflow in regexp matcher")
[...]
> BTW (probably unrelated to bug): In Emacs 20, doing the same thing,
> but using this similar regexp (no non-greedy matching), succeeds, with
> no Stack overflow error:
> "\"\\([^\\\"]\\|\\\\\\(.\\|[\n]\\)\\)*\"\\|`[^']+'"

The stack-overflow error depends on the text being matched.  In the present
case, the condition for this error is basically that TEXT/N > STACK where
TEXT is the number of chars in the buffer (after point), STACK is the amount
of stack space left when the function is called, and N is a constant that
depends on how the regex.c code is compiled (i.e. things like size of `int'
and pointers).  N has changed between Emacs-20 and Emacs-21, so maybe that's
the source of the problem (I can't remember if N got smaller or bigger,
tho), but a more likely situation is that TEXT was not the same in your
two tests.


        Stefan





reply via email to

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