diff options
| author | Dmitry Antipov | 2012-08-21 14:21:04 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-08-21 14:21:04 +0400 |
| commit | 086ca913a8495b1d4f0d7eae58aea75f2f5e44ae (patch) | |
| tree | 0eb5a3cb36efc4b1f2209dfa74be7d6fd3c1b034 /src/fns.c | |
| parent | 0e733db9150ea50dc1a3687a0898d6264c4cabd8 (diff) | |
| download | emacs-086ca913a8495b1d4f0d7eae58aea75f2f5e44ae.tar.gz emacs-086ca913a8495b1d4f0d7eae58aea75f2f5e44ae.zip | |
Avoid direct writes to contents member of struct Lisp_Vector.
* lisp.h (vcopy): New function to copy data into vector.
* dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
* fns.c (Ffillarray): Use ASET.
* keyboard.c (timer_check_2): Use AREF and ASET.
(append_tool_bar_item, Frecent_keys): Use vcopy.
* lread.c (read_vector): Use ASET.
* msdos.c (Frecent_doskeys): Use vcopy.
* xface.c (Finternal_copy_lisp_face): Use vcopy.
(Finternal_merge_in_global_face): Use ASET and vcopy.
* xfont.c (xfont_list_pattern): Likewise.
Diffstat (limited to 'src/fns.c')
| -rw-r--r-- | src/fns.c | 8 |
1 files changed, 2 insertions, 6 deletions
| @@ -2139,12 +2139,8 @@ ARRAY is a vector, string, char-table, or bool-vector. */) | |||
| 2139 | register ptrdiff_t size, idx; | 2139 | register ptrdiff_t size, idx; |
| 2140 | 2140 | ||
| 2141 | if (VECTORP (array)) | 2141 | if (VECTORP (array)) |
| 2142 | { | 2142 | for (idx = 0, size = ASIZE (array); idx < size; idx++) |
| 2143 | register Lisp_Object *p = XVECTOR (array)->contents; | 2143 | ASET (array, idx, item); |
| 2144 | size = ASIZE (array); | ||
| 2145 | for (idx = 0; idx < size; idx++) | ||
| 2146 | p[idx] = item; | ||
| 2147 | } | ||
| 2148 | else if (CHAR_TABLE_P (array)) | 2144 | else if (CHAR_TABLE_P (array)) |
| 2149 | { | 2145 | { |
| 2150 | int i; | 2146 | int i; |