Skip to content

Commit 473cdf0

Browse files
committed
Fix a bug in predicate patterns.
1 parent b0e9c8a commit 473cdf0

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

langs/outlaw/compile-expr.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@
368368
(seq (Lea r15 r)
369369
(Push r15) ; rp
370370
(Push rax) ; arg (saved for the moment)
371-
(compile-e e (list* #f #f c) g #f)
371+
(compile-e e (list* #f #f (append cm c)) g #f)
372372
(Pop r15) ;; HERE
373373
(Push rax)
374374
(Push r15)

langs/outlaw/test/test-runner.rkt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,12 @@
677677
(check-equal? (run '(* 8 3)) 24)
678678
(check-equal? (run '(* 16 2)) 32)
679679
(check-equal? (run '(* 10 5)) 50)
680-
(check-equal? (run '(* 64 2)) 128))
680+
(check-equal? (run '(* 64 2)) 128)
681+
(check-equal? (run '(let ((pred (lambda (x) #t)))
682+
(match 0
683+
[(and (? pred) _) #t]
684+
[_ #f])))
685+
#t))
681686

682687

683688
(define (test-runner-io run)

0 commit comments

Comments
 (0)