diff options
| author | Mattias EngdegÄrd | 2022-12-06 12:13:18 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2022-12-06 12:13:18 +0100 |
| commit | 9b9b39a2d8979af7430a4e2370ef7857c4a2dbce (patch) | |
| tree | c573984732e7f623e0075e2071eb95ba12178394 | |
| parent | 717f8477284170dd59315a3c64cc7e492e9366e2 (diff) | |
| download | emacs-9b9b39a2d8979af7430a4e2370ef7857c4a2dbce.tar.gz emacs-9b9b39a2d8979af7430a4e2370ef7857c4a2dbce.zip | |
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.
| -rw-r--r-- | src/lread.c | 4 |
1 files 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) | |||
| 3375 | break; | 3375 | break; |
| 3376 | } | 3376 | } |
| 3377 | if (INT_MULTIPLY_WRAPV (length, 10, &length) | 3377 | if (INT_MULTIPLY_WRAPV (length, 10, &length) |
| 3378 | | INT_ADD_WRAPV (length, c - '0', &length)) | 3378 | || INT_ADD_WRAPV (length, c - '0', &length)) |
| 3379 | invalid_syntax ("#&", readcharfun); | 3379 | invalid_syntax ("#&", readcharfun); |
| 3380 | } | 3380 | } |
| 3381 | 3381 | ||
| @@ -3421,7 +3421,7 @@ skip_lazy_string (Lisp_Object readcharfun) | |||
| 3421 | break; | 3421 | break; |
| 3422 | } | 3422 | } |
| 3423 | if (INT_MULTIPLY_WRAPV (nskip, 10, &nskip) | 3423 | if (INT_MULTIPLY_WRAPV (nskip, 10, &nskip) |
| 3424 | | INT_ADD_WRAPV (nskip, c - '0', &nskip)) | 3424 | || INT_ADD_WRAPV (nskip, c - '0', &nskip)) |
| 3425 | invalid_syntax ("#@", readcharfun); | 3425 | invalid_syntax ("#@", readcharfun); |
| 3426 | digits++; | 3426 | digits++; |
| 3427 | if (digits == 2 && nskip == 0) | 3427 | if (digits == 2 && nskip == 0) |