From 330c6ea83f492672578b62d0683acbb532d1a5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 20 Sep 2021 23:24:24 +0200 Subject: [PATCH] Fix 'ash' primcall match clause in baseline compiler. Previously the pattern would only match when the two 'src' values were the same, which is not the case for example when running on the interpreter. * module/language/tree-il/compile-bytecode.scm (canonicalize): In 'ash primcall pattern, rename second 'src' to 'src*'. --- module/language/tree-il/compile-bytecode.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/language/tree-il/compile-bytecode.scm b/module/language/tree-il/compile-bytecode.scm index c495d2ae6..551ae68e9 100644 --- a/module/language/tree-il/compile-bytecode.scm +++ b/module/language/tree-il/compile-bytecode.scm @@ -459,10 +459,10 @@ v))) ;; Transform "ash" to lsh / rsh. - (($ src 'ash (x ($ src (? exact-integer? y)))) + (($ src 'ash (x ($ src* (? exact-integer? y)))) (if (negative? y) - (make-primcall src 'lsh (list x (make-const src (- y)))) - (make-primcall src 'rsh (list x (make-const src y))))) + (make-primcall src 'lsh (list x (make-const src* (- y)))) + (make-primcall src 'rsh (list x (make-const src* y))))) ;; (throw key subr msg (list x) (list x)) (($ src 'throw