summaryrefslogtreecommitdiffstats
path: root/stream.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-12-14 06:53:33 -0800
committerKaz Kylheku <kaz@kylheku.com>2018-12-14 06:53:33 -0800
commit39888e21ad17f5abbeaddc876f734a9683b5b914 (patch)
treea423fa540f146827d07e25895ce68cc006d95497 /stream.h
parented3b186632459b3b6ca0e26fdae81329e0959729 (diff)
downloadtxr-39888e21ad17f5abbeaddc876f734a9683b5b914.tar.gz
txr-39888e21ad17f5abbeaddc876f734a9683b5b914.tar.bz2
txr-39888e21ad17f5abbeaddc876f734a9683b5b914.zip
defvar: bugfix: bad state caused by exception.
The following situation can occur: (defvar v expr) ;; expr throws! What happens is that the internal hash table of global variables ends up with an entry that has a nil value, instead of the expected (v . <value>) cons cell. The hash table entry is created when the table is probed for the existence of v, but then is never populated with a binding because expr throws. The consequence then is that (boundp v) returns nil, yet subsequent (defvar v ...) expressions think that v exists, and refuse to define it. (defparm v ...) also fails; it relies on (defvar ...) which fails to define the variable, and then tries to assign to it, which throws. * eval.c (rt_defvarl): If the hash table exists, but has a nil value, treat that as an undefined variable. Thus, define the variable not only if the hash cell is newly made, but also if it already exists, with a null cdr.
Diffstat (limited to 'stream.h')
0 files changed, 0 insertions, 0 deletions