emacs-diffs
[Top][All Lists]
Advanced

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

master 3b5f13dc49f 1/2: ; Fix bug in regexp debug code


From: Mattias Engdegård
Subject: master 3b5f13dc49f 1/2: ; Fix bug in regexp debug code
Date: Fri, 21 Jul 2023 08:52:01 -0400 (EDT)

branch: master
commit 3b5f13dc49f3a2a7afd25a2ab05787c7d81918a0
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    ; Fix bug in regexp debug code
    
    * src/regex-emacs.c (print_partial_compiled_pattern):
    Only the 7 bottom bits of the first byte form the bitmap size.
---
 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 9e298b81ebb..51fc2b0558d 100644
--- a/src/regex-emacs.c
+++ b/src/regex-emacs.c
@@ -554,7 +554,7 @@ print_partial_compiled_pattern (re_char *start, re_char 
*end)
            fprintf (stderr, "/charset [%s",
                     (re_opcode_t) *(p - 1) == charset_not ? "^" : "");
 
-           if (p + *p >= pend)
+           if (p + (*p & 0x7f) >= pend)
              fputs (" !extends past end of pattern! ", stderr);
 
            for (c = 0; c < 256; c++)



reply via email to

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