diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-11-23 20:47:41 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-11-23 20:47:41 -0800 |
commit | dbbe05f214787b6ef8f90bda8ea3458a72e3081b (patch) | |
tree | 171010986d8babebc4493661c62f6a652620df65 /eval.c | |
parent | 026acf026747478ed25f20671b43c084dd0cbff8 (diff) | |
download | txr-dbbe05f214787b6ef8f90bda8ea3458a72e3081b.tar.gz txr-dbbe05f214787b6ef8f90bda8ea3458a72e3081b.tar.bz2 txr-dbbe05f214787b6ef8f90bda8ea3458a72e3081b.zip |
bugfix: reading hash literals with circ notation.
The backpatching of literal hash objects containing
circular notation labels is incorrect, because it
directly mutates the hash keys, without regard for
the fact that this alters their hash values.
This change makes the test case #1=#H(() (#1# #1#))
work properly: a hash which contains itself as a key
and corresponding value. When this object is constructed by
the reader, we can do a gethash call on it, using itself as
the key, and it emerges as the value. Before this fix,
nil would be returned indicating that the key is not found,
although it is listed in the table (corrupt hash).
* parser.c (circ_backpatch): When traversing a hash, local
list of the cells. Then clear the hash, iterate the list of
old cells, and re-insert the key-value pairs.
Diffstat (limited to 'eval.c')
0 files changed, 0 insertions, 0 deletions