diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-09-23 21:33:01 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-09-23 21:33:01 -0700 |
commit | 57f625f68909a4420e5621a2f40717427ecf63e2 (patch) | |
tree | 6304b8e32c2b8119af7213576550b557af656fd5 /arith.h | |
parent | 77b5a3eda0eda28b30addcfcd62cce1bae8542cf (diff) | |
download | txr-57f625f68909a4420e5621a2f40717427ecf63e2.tar.gz txr-57f625f68909a4420e5621a2f40717427ecf63e2.tar.bz2 txr-57f625f68909a4420e5621a2f40717427ecf63e2.zip |
Bugfix: out-of-range negative indices into lists.
We have a problem not handling negative list indices
which index beyond the beginning of the list.
Such accesses are just storing and retrieving the
first element!
* lib.c (listref): If a negative index is still negative
after the length of the list is added to it, then
return nil. Do not return car(list)!
(listref_l): Similary, do not return car_l(list) if
the index is less than zero, so that an error
occurs for an out-of-range negative index.
* txr.1: Update the documentation for ref
to describe these indexing constraints, and also
to include hashes.
Diffstat (limited to 'arith.h')
0 files changed, 0 insertions, 0 deletions