diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-05-04 20:51:44 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-05-04 20:51:44 -0700 |
commit | 33c229bbbbf75ab8b3f048579eb2b7a63acaae7d (patch) | |
tree | 18aee90ef9ac3054fdcbf6285711532ea4862ad2 /lib.c | |
parent | e5186dace2ce5c13c2a178b67507a3f917f4ed25 (diff) | |
download | txr-33c229bbbbf75ab8b3f048579eb2b7a63acaae7d.tar.gz txr-33c229bbbbf75ab8b3f048579eb2b7a63acaae7d.tar.bz2 txr-33c229bbbbf75ab8b3f048579eb2b7a63acaae7d.zip |
ffi: bugfix: zarray put accessing last element.
A zarray of length N is requiring the Lisp vector to be
of length N.
* ffi.c (ffi_array_put): Reorder logic in the loop so that
when we are putting out the terminating null element of a
zarray, we do not access the corresponding element of the Lisp
vector. Thus if the zarray is N elements wide, the Lisp
vector need only be at least N-1 elements wide, not N.
(ffi_array_in): Copy the null element of a zarray to the
vector only if the vector object at least N elements.
If the vector is nil so that we have to construct one,
construct a vector of N-1 for a zarray.
(ffi_array_get): For a zarray, construct a vector of N-1
elements. Do not even fetch the null.
Diffstat (limited to 'lib.c')
0 files changed, 0 insertions, 0 deletions