]> git.eshelyaron.com Git - emacs.git/commitdiff
Lisp reader undefined behaviour excision
authorMattias Engdegård <mattiase@acm.org>
Tue, 6 Dec 2022 11:13:18 +0000 (12:13 +0100)
committerMattias Engdegård <mattiase@acm.org>
Tue, 6 Dec 2022 11:13:18 +0000 (12:13 +0100)
* 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

index 0a6e4201e40baa6c4e20079aef30f2e09ef0d74f..68bc1431765b1dd62d70253afc717db38865f96a 100644 (file)
@@ -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)