projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d3d419
)
* src/regex-emacs.c (mutually_exclusive_p): Fix inf-loop (bug#65726)
author
Stefan Monnier
<monnier@iro.umontreal.ca>
Mon, 4 Sep 2023 17:11:31 +0000
(13:11 -0400)
committer
Stefan Monnier
<monnier@iro.umontreal.ca>
Mon, 4 Sep 2023 17:11:31 +0000
(13:11 -0400)
src/regex-emacs.c
patch
|
blob
|
history
diff --git
a/src/regex-emacs.c
b/src/regex-emacs.c
index 2571812cb3981c365de7c02734eed0b78f3abfa0..fb4e5b26b5661b20adca8c11c2cc750e4d760cb9 100644
(file)
--- a/
src/regex-emacs.c
+++ b/
src/regex-emacs.c
@@
-3834,7
+3834,7
@@
mutually_exclusive_p (struct re_pattern_buffer *bufp, re_char *p1,
EXTRACT_NUMBER_AND_INCR (mcnt, p2);
/* Don't just test `mcnt > 0` because non-greedy loops have
their test at the end with an unconditional jump at the start. */
- if (p2
+ mcnt > p2_orig
) /* Ensure forward progress. */
+ if (p2
> p2_orig && mcnt >= 0
) /* Ensure forward progress. */
return (mutually_exclusive_p (bufp, p1, p2)
&& mutually_exclusive_p (bufp, p1, p2 + mcnt));
break;