[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BUG 20703 further evidence

From: Sam Halliday
Subject: BUG 20703 further evidence
Date: Wed, 13 Jan 2016 09:54:48 -0800 (PST)
User-agent: G2/1.0

Hi all,

I have been seeing a problem that is described in this bug report

I have applied the suggested patch to etags-tags-completion-table (copied below 
in completeness for your convenience) and trapped an error case.

I'm triggering the error in an extremely long line of code (46,000 
characters!). I presume somebody programmatically generated the line and pasted 
it into the source. A workaround could be to simply filter such lines at the 
ctag building or loading stage, just something that deletes "long" lines, 
whatever that may mean. Probably 500 characters is long enough!

I could also look at adding maximum sizes to my regexes in ctags, but that 
really isn't a general solution because many ctags patterns do not have such 

(defun etags-tags-completion-table () ; Doc string?
  (let ((table (make-vector 511 0))
          (format "Making tags completion table for %s..." buffer-file-name)
          (point-min) (point-max))))
      (goto-char (point-min))
      ;; This monster regexp matches an etags tag line.
      ;;   \1 is the string to match;
      ;;   \2 is not interesting;
      ;;   \3 is the guessed tag name; XXX guess should be better eg DEFUN
      ;;   \4 is not interesting;
      ;;   \5 is the explicitly-specified tag name.
      ;;   \6 is the line to start searching at;
      ;;   \7 is the char to start searching at.
      (condition-case err
          (while (re-search-forward
                  nil t)
            (intern     (prog1 (if (match-beginning 5)
                               ;; There is an explicit tag name.
                               (buffer-substring (match-beginning 5) (match-end 
                             ;; No explicit tag name.  Best guess.
                             (buffer-substring (match-beginning 3) (match-end 
                      (progress-reporter-update progress-reporter (point)))
           (message "error happened near %d" (point))
           (error (error-message-string err)))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]