diff options
| author | Andreas Schwab | 2003-11-25 12:22:08 +0000 |
|---|---|---|
| committer | Andreas Schwab | 2003-11-25 12:22:08 +0000 |
| commit | 00498bfc928ebe82169895fa899785dec5c808e5 (patch) | |
| tree | c040b208417f57896d67d1fb3a94f4149a7d57bd | |
| parent | 95e52d88883c4b5e195f7f27ef3779551621f977 (diff) | |
| download | emacs-00498bfc928ebe82169895fa899785dec5c808e5.tar.gz emacs-00498bfc928ebe82169895fa899785dec5c808e5.zip | |
(internal_equal) <case Lisp_Vectorlike>: Declare size as
EMACS_INT to not lose bits.
(Ffillarray): Don't set bits beyond the size of a bool vector.
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/fns.c | 13 |
2 files changed, 16 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 95b5f247e4d..605ed62bc3f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2003-11-25 Andreas Schwab <schwab@suse.de> | ||
| 2 | |||
| 3 | * fns.c (internal_equal) <case Lisp_Vectorlike>: Declare size as | ||
| 4 | EMACS_INT to not lose bits. | ||
| 5 | (Ffillarray): Don't set bits beyond the size of a bool vector. | ||
| 6 | |||
| 1 | 2003-11-25 Kim F. Storm <storm@cua.dk> | 7 | 2003-11-25 Kim F. Storm <storm@cua.dk> |
| 2 | 8 | ||
| 3 | * print.c (Fredirect_debugging_output) [!GNU_LINUX]: Do not | 9 | * print.c (Fredirect_debugging_output) [!GNU_LINUX]: Do not |
| @@ -2192,8 +2192,8 @@ internal_equal (o1, o2, depth) | |||
| 2192 | 2192 | ||
| 2193 | case Lisp_Vectorlike: | 2193 | case Lisp_Vectorlike: |
| 2194 | { | 2194 | { |
| 2195 | register int i, size; | 2195 | register int i; |
| 2196 | size = XVECTOR (o1)->size; | 2196 | EMACS_INT size = XVECTOR (o1)->size; |
| 2197 | /* Pseudovectors have the type encoded in the size field, so this test | 2197 | /* Pseudovectors have the type encoded in the size field, so this test |
| 2198 | actually checks that the objects have the same type as well as the | 2198 | actually checks that the objects have the same type as well as the |
| 2199 | same size. */ | 2199 | same size. */ |
| @@ -2315,8 +2315,15 @@ ARRAY is a vector, string, char-table, or bool-vector. */) | |||
| 2315 | = (XBOOL_VECTOR (array)->size + BITS_PER_CHAR - 1) / BITS_PER_CHAR; | 2315 | = (XBOOL_VECTOR (array)->size + BITS_PER_CHAR - 1) / BITS_PER_CHAR; |
| 2316 | 2316 | ||
| 2317 | charval = (! NILP (item) ? -1 : 0); | 2317 | charval = (! NILP (item) ? -1 : 0); |
| 2318 | for (index = 0; index < size_in_chars; index++) | 2318 | for (index = 0; index < size_in_chars - 1; index++) |
| 2319 | p[index] = charval; | 2319 | p[index] = charval; |
| 2320 | if (index < size_in_chars) | ||
| 2321 | { | ||
| 2322 | /* Mask out bits beyond the vector size. */ | ||
| 2323 | if (XBOOL_VECTOR (array)->size % BITS_PER_CHAR) | ||
| 2324 | charval &= (1 << (XBOOL_VECTOR (array)->size % BITS_PER_CHAR)) - 1; | ||
| 2325 | p[index] = charval; | ||
| 2326 | } | ||
| 2320 | } | 2327 | } |
| 2321 | else | 2328 | else |
| 2322 | { | 2329 | { |