summaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-07-10 06:56:21 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-07-10 06:56:21 -0700
commitde76e0a57c28cd102994227483cec5ac7eaccd8e (patch)
treea7fa77b3645d761e4cfd6104cebb62e2b23b7af9 /struct.c
parentacd1500cefaddba4a41689fe6d4d7bd2c99b759e (diff)
downloadtxr-de76e0a57c28cd102994227483cec5ac7eaccd8e.tar.gz
txr-de76e0a57c28cd102994227483cec5ac7eaccd8e.tar.bz2
txr-de76e0a57c28cd102994227483cec5ac7eaccd8e.zip
compiler: bugfix: mishandled empty test
* share/txr/stdlib/compiler.tl (compiler comp-for): Fix exception thrown when compiling (for init test step ...) when test is nil. Firstly, we must distinguish a (nil) test from (), because the latter means (t). Hence the need for the test-p Boolean. The list of frags must not contain a nil, which isn't a frag. The instruction template must not only omit generating the conditional jump when the test is absent, but also omit generating the test code (insertion of tfrag.code) in that case, because tfrag is nil.
Diffstat (limited to 'struct.c')
0 files changed, 0 insertions, 0 deletions