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

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

Re: c-mode imenu: Stack overflow in regexp matcher


From: Glenn Morris
Subject: Re: c-mode imenu: Stack overflow in regexp matcher
Date: Tue, 06 Feb 2007 19:13:08 -0500
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Stefan Monnier wrote:

> Please try and play with the text being matched to try and see which
> part of the regexp is causing an overflow. Most likely the problem
> is that something is matching a much longer text than expected (e.g.
> tens/hundreds of nonempty lines rather than 1 or 2).
>
> Maybe it's the beginning: "^\\<[^()]*" since the \< only implies
> that the first char will be a word-constituent, and the [^()]* can
> then match any number of chars as long as there's no intervening
> parenthesis, which seems quite possible in a long comment.

This will do it:

(goto-char (point-max))
(re-search-backward "^\\<[^()]*[^[:alnum:]_:<>~]")

It matches the whole of etc/splash.xpm from "static char..." right
through to the end, some 60000 odd characters later.





reply via email to

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