Fix Error with regexp Stack Overflows #131
Merged
+5
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, I kept getting
error in process sentinel: Wrong type argument: magit-todos-item, t
whenever I opened the magit status buffer for a file in the https://github.com/github/linguist repo.I found that when a stack overflow occurred during regexp matching
(display-warning 'magit-todos (concat "File has lines too long for Emacs to search. Consider excluding it from scans: " filename))
was returningt
, which was causing the enclosing--when-let
to treat thet
as a todo item and add it to the list of todo items, which caused the above error when writing it to a buffer.AFAICS the doc for
display-warning
doesn't say anything about its return value ((display-warning 'foo "foo")
returnst
🤷), so for surety this PR just addsnil
to the next line.I can reproduce it with minimal config using the following:
git clone https://github.com/github/linguist
(though I think any repo with an uber line will do, e.g. this file is the culprit in that repo: https://github.com/github/linguist/blob/master/test/fixtures/Data/bootstrap.css.map)./makem.sh interactive
magit-todos-mode
,magit
Thanks!