From f3523b17a8cf4d4d5babc8a8e75cf7004fbb8d48 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 17 Oct 2007 01:37:23 +0000 Subject: [PATCH] (cc-imenu-c++-generic-expression): Tweak regexp to avoid overflow. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/cc-menus.el | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2e5bb8bd790..2ea970016ba 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-17 Glenn Morris + + * progmodes/cc-menus.el (cc-imenu-c++-generic-expression): Tweak + regexp to avoid stack overflow. + 2007-10-16 Stefan Monnier * simple.el (reindent-then-newline-and-indent): Don't assume that diff --git a/lisp/progmodes/cc-menus.el b/lisp/progmodes/cc-menus.el index 95359689b9f..eced014d4e6 100644 --- a/lisp/progmodes/cc-menus.el +++ b/lisp/progmodes/cc-menus.el @@ -106,7 +106,9 @@ A sample value might look like: `\\(_P\\|_PROTO\\)'.") (nil ,(concat "^\\<" ; line MUST start with word char - "[^()]*" ; no parentheses before + ;; \n added to prevent overflow in regexp matcher. + ;; http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-02/msg00021.html + "[^()\n]*" ; no parentheses before "[^" c-alnum "_:<>~]" ; match any non-identifier char "\\([" c-alpha "_][" c-alnum "_:<>~]*\\)" ; match function name "\\([ \t\n]\\|\\\\\n\\)*(" ; see above, BUT the arg list -- 2.39.5