summaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-08-31 22:10:26 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-08-31 22:10:26 -0700
commit7dc1bd077837c61d2ebdeb53f7ae896a760011fe (patch)
tree5af29037377837cdfe5f107572b32065c1d48f6e /struct.c
parent7f433a9322af7d0cf4d0ded99a34113e82650add (diff)
downloadtxr-7dc1bd077837c61d2ebdeb53f7ae896a760011fe.tar.gz
txr-7dc1bd077837c61d2ebdeb53f7ae896a760011fe.tar.bz2
txr-7dc1bd077837c61d2ebdeb53f7ae896a760011fe.zip
interpreter: bug between let* and continuations.
This was discovered by user vapnik spaknik. If a let* form is evaluated in a top-level expression such that the incoming environment is null, and a continuation is captured in the init-form of the first variable, when that continuation is invoked, an exception is thrown: "copy-env: nil is not of type env". Short repro: 1> (block nil (let* ((x (yield 42))))) ** copy-env: nil is not of type env In fact, the bug isn't that we're trying to copy nil. the problem is we are trying to copy an environment we should not be copying at all. In fact, for sequential binding, there is no need for that logic at all; it's only parallel binding which needs it, because all of the init-forms are inserting bindings into the same environment. * eval.c (bindings_helper): Don't bother with registering a copy handler for sequential binding logic, because we don't mutate environments. All of that code is moved into the parallel case.
Diffstat (limited to 'struct.c')
0 files changed, 0 insertions, 0 deletions