From 418efac4c62fc4133b2d87aabd318b3567ecf3c1 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Mon, 29 Jul 2013 02:34:22 +0200 Subject: Avoiding a segfault due to out of bounds stack size The parser in geiser-syntax is (tail, but elisp doesn't care) recursive, and we are setting max-lisp-eval-depth to some, ahem, heuristic value before starting a read. For long strings, such as that returned by the list of identifiers exported by the racket module, the heuristic was bad enough to produce a value making Emacs to blow away. This is just a palliative. The real solution is turn the recursion in geiser-syntax--read into an explicit iteration. --- elisp/geiser-syntax.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'elisp') diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el index d790734..7a33770 100644 --- a/elisp/geiser-syntax.el +++ b/elisp/geiser-syntax.el @@ -197,7 +197,8 @@ implementation-specific entries for font-lock-keywords.") (when (stringp string) (let* ((start (or start 0)) (end (or end (length string))) - (max-lisp-eval-depth (max max-lisp-eval-depth (- end start)))) + (max-lisp-eval-depth (min 20000 + (max max-lisp-eval-depth (- end start))))) (with-temp-buffer (save-excursion (insert string)) (cons (ignore-errors (geiser-syntax--read)) (point)))))) -- cgit v1.2.3