From 27883d274967c599f6fddd12711e30a1d7ab85c8 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 6 Jan 2020 04:35:26 -0700 Subject: [PATCH] another repair to `bitwise-arithmetic-shift`/`ash` folding Fuzz testing exposed a problem with the example (bitwise-arithmetic-shift-left -1 -1) original commit: fc6f411ffc65f436d54979dfc0455ae771f3375d --- s/cp0.ss | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/s/cp0.ss b/s/cp0.ss index d4464e8a61..a2f75207fe 100644 --- a/s/cp0.ss +++ b/s/cp0.ss @@ -2419,9 +2419,10 @@ (and xval yval (let ([r (guard (c [#t #f]) (op xval yval))]) - (when r - (residualize-seq '() (list x y) ctxt) - `(quote ,r)))))) + (cond + [r (residualize-seq '() (list x y) ctxt) + `(quote ,r)] + [else #f]))))) (define-syntax define-inline-ash-op (syntax-rules () [(_ op)