emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 6fad73d7cc5: * src/regex-emacs.c (mutually_exclusive_p): Fix in


From: Stefan Monnier
Subject: emacs-29 6fad73d7cc5: * src/regex-emacs.c (mutually_exclusive_p): Fix inf-loop (bug#65726)
Date: Mon, 4 Sep 2023 13:11:42 -0400 (EDT)

branch: emacs-29
commit 6fad73d7cc53116962d8b0c07b13b8e7d5bc6f65
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * src/regex-emacs.c (mutually_exclusive_p): Fix inf-loop (bug#65726)
---
 src/regex-emacs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/regex-emacs.c b/src/regex-emacs.c
index 2571812cb39..fb4e5b26b56 100644
--- 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;



reply via email to

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