diff options
| author | Paul Eggert | 2020-01-22 23:43:29 -0800 |
|---|---|---|
| committer | Paul Eggert | 2020-01-22 23:44:34 -0800 |
| commit | 6f580542c1796d3e7ba4d1dd40b2fe73fe00e5db (patch) | |
| tree | ed853d4d27a2f231d7fe13a4affb723d0ce28eeb /test/src/alloc-tests.el | |
| parent | 5715eb94e90b33ace59dd4c4ccb6e2122bc6db72 (diff) | |
| download | emacs-6f580542c1796d3e7ba4d1dd40b2fe73fe00e5db.tar.gz emacs-6f580542c1796d3e7ba4d1dd40b2fe73fe00e5db.zip | |
Fix crash when sending Gnus message (Bug#39207)
* src/alloc.c (resize_string_data): The string must be multibyte.
When not bothering to reallocate, do bother to change the byte count.
* test/src/alloc-tests.el (aset-nbytes-change) New test.
Diffstat (limited to 'test/src/alloc-tests.el')
| -rw-r--r-- | test/src/alloc-tests.el | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/src/alloc-tests.el b/test/src/alloc-tests.el index 4eb776a0555..aa1ab1648f8 100644 --- a/test/src/alloc-tests.el +++ b/test/src/alloc-tests.el | |||
| @@ -51,3 +51,10 @@ | |||
| 51 | (should-not (eq x y)) | 51 | (should-not (eq x y)) |
| 52 | (dotimes (i 4) | 52 | (dotimes (i 4) |
| 53 | (should (eql (aref x i) (aref y i)))))) | 53 | (should (eql (aref x i) (aref y i)))))) |
| 54 | |||
| 55 | ;; Bug#39207 | ||
| 56 | (ert-deftest aset-nbytes-change () | ||
| 57 | (let ((s (make-string 1 ?a))) | ||
| 58 | (dolist (c (list 10003 ?b 128 ?c ?d (max-char) ?e)) | ||
| 59 | (aset s 0 c) | ||
| 60 | (should (equal s (make-string 1 c)))))) | ||