mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Avoid regexp stack overflow in GDB string matching (bug#22149)
* lisp/progmodes/gdb-mi.el (gdb--string-regexp): Swap the or-clauses so that the rarely matching one comes first. This avoids a build-up of backtrack points on the regexp stack.
This commit is contained in:
parent
6bdb561a3b
commit
7195ea7532
1 changed files with 4 additions and 1 deletions
|
|
@ -1046,7 +1046,10 @@ no input, and GDB is waiting for input."
|
|||
|
||||
(declare-function tooltip-show "tooltip" (text &optional use-echo-area))
|
||||
|
||||
(defconst gdb--string-regexp "\"\\(?:[^\\\"]\\|\\\\.\\)*\"")
|
||||
(defconst gdb--string-regexp (rx "\""
|
||||
(* (or (seq "\\" nonl)
|
||||
(not (any "\"\\"))))
|
||||
"\""))
|
||||
|
||||
(defun gdb-tooltip-print (expr)
|
||||
(with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue