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

2007-02-19 Thread Glenn Morris
Stefan Monnier wrote: Yes, I saw that, but it's still not clear to me what's going on here. E.g. the match any non-identifier char can match a parenthesis, is that correct? I guess a quick fix is to replace [^()] by [^()\n]. Ping, anyone in CC land? The problematic [^()]* part was

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

2007-02-19 Thread Nick Roberts
G I guess a quick fix is to replace [^()] by [^()\n]. Ping, anyone in CC land? Don't know about CC land, but I'd say there are a few in la-la land. -- Nick http://www.inet.net.nz/~nickrob ___

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

2007-02-07 Thread Stefan Monnier
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:

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

2007-02-07 Thread Kim F. Storm
Stefan Monnier [EMAIL PROTECTED] writes: 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 6 odd characters later. Good, thanks. Then now we have to find

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

2007-02-07 Thread Stefan Monnier
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 6 odd characters later. Good, thanks. Then now we have to find someone who knows what the regexp is

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

2007-02-06 Thread Glenn Morris
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

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

2007-02-04 Thread Stefan Monnier
I've reduced the problem to a regexp search called from: (imenu--generic-function imenu-generic-expression) Evaluating the following in a buffer visiting splash.xpm as text causes a stack overflow in the regexp matcher: (goto-char (point-max)) (re-search-backward

c-mode imenu: Stack overflow in regexp matcher

2007-02-02 Thread Glenn Morris
From the top-level directory of a recent Emacs build: ./src/emacs -Q --eval (add-hook 'c-mode-hook 'imenu-add-menubar-index) \ ./etc/splash.xpm Error in menu-bar-update-hook: (error Stack overflow in regexp matcher) ___ emacs-pretest-bug

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

2007-02-02 Thread Chong Yidong
Glenn Morris [EMAIL PROTECTED] writes: From the top-level directory of a recent Emacs build: ./src/emacs -Q --eval (add-hook 'c-mode-hook 'imenu-add-menubar-index) \ ./etc/splash.xpm Error in menu-bar-update-hook: (error Stack overflow in regexp matcher) I can't reproduce this with the

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

2007-02-02 Thread Glenn Morris
Chong Yidong wrote: I can't reproduce this with the latest CVS sources: GNU Emacs 22.0.93.23 (i686-pc-linux-gnu, GTK+ Version 2.8.20) I see the problem on x86_64-unknown-linux-gnu (RHEL 4), but not on i686-pc-linux-gnu. (GNU Emacs 22.0.93.1, X toolkit in both cases.) Do any other

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

2007-02-02 Thread Glenn Morris
I've reduced the problem to a regexp search called from: (imenu--generic-function imenu-generic-expression) Evaluating the following in a buffer visiting splash.xpm as text causes a stack overflow in the regexp matcher: (goto-char (point-max)) (re-search-backward