emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 9b9b39a2d89: Lisp reader undefined behaviour excision


From: Mattias Engdegård
Subject: emacs-29 9b9b39a2d89: Lisp reader undefined behaviour excision
Date: Tue, 6 Dec 2022 06:21:02 -0500 (EST)

branch: emacs-29
commit 9b9b39a2d8979af7430a4e2370ef7857c4a2dbce
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    Lisp reader undefined behaviour excision
    
    * src/lread.c (read_bool_vector, skip_lazy_string):
    Replace `|` with `||` to explicitly introduce sequence points since
    the variables, `length` and `nskip`, are mutated more than once.
    
    The `|` was just a weak attempt at micro-optimisation in any case;
    sorry about that.
---
 src/lread.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lread.c b/src/lread.c
index 0a6e4201e40..68bc1431765 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3375,7 +3375,7 @@ read_bool_vector (Lisp_Object readcharfun)
          break;
        }
       if (INT_MULTIPLY_WRAPV (length, 10, &length)
-         | INT_ADD_WRAPV (length, c - '0', &length))
+         || INT_ADD_WRAPV (length, c - '0', &length))
        invalid_syntax ("#&", readcharfun);
     }
 
@@ -3421,7 +3421,7 @@ skip_lazy_string (Lisp_Object readcharfun)
          break;
        }
       if (INT_MULTIPLY_WRAPV (nskip, 10, &nskip)
-         | INT_ADD_WRAPV (nskip, c - '0', &nskip))
+         || INT_ADD_WRAPV (nskip, c - '0', &nskip))
        invalid_syntax ("#@", readcharfun);
       digits++;
       if (digits == 2 && nskip == 0)



reply via email to

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