summaryrefslogtreecommitdiffstats
path: root/chksum.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-04-20 06:34:57 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-04-20 06:34:57 -0700
commitca6020cff56c12958b6be1e75fa5fde29557649a (patch)
treed974c0a4ffcdcd158b8ab3a5ddf471089b1e70f2 /chksum.c
parentc99dd869357f2afd0b79dfc24f9e9953d9129837 (diff)
downloadtxr-ca6020cff56c12958b6be1e75fa5fde29557649a.tar.gz
txr-ca6020cff56c12958b6be1e75fa5fde29557649a.tar.bz2
txr-ca6020cff56c12958b6be1e75fa5fde29557649a.zip
compiler: bugfix: constant test in 2 or 3 arg if.
* share/txr/stdlib/compiler.tl (compiler comp-if): The two and three argument cases assume that if the test is a constant expression, the consequent "then" should be unconditionally taken. The correct behavior is to evaluate the constant, which could yield nil. I checked which library code changes after this fix, and found that a number of (defset ...) forms are generating different, shorter code. This is due to (if ',restpar (if (consp ,restpar) ...)) in defset-expander. The intent there was to eliminate the inner if code entirely if respar is nil (there is no rest parameter); due to this bug, the code elimination didn't happen. The behavior is nevertheless correct because the code does nothing if restpar is nil.
Diffstat (limited to 'chksum.c')
0 files changed, 0 insertions, 0 deletions