1
Fork 0
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:
Mattias Engdegård 2020-03-13 19:51:02 +01:00
parent 6bdb561a3b
commit 7195ea7532

View file

@ -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)