The attached test case works in csi but fails in csc.
Possibly related to optimization options. Compile as:
csc -O3 -clustering -no-argc-checks -no-procedure-checks
-no-bound-checks -no-trace -no-lambda-info -specialize -lfa2
-strict-types -disable-stack-overflow-checks -unsafe test-failing.scm
to see it terminate with exit code 1.
BTW: I'd have expected the assert (not (foo? "a b")) to kick in, but
this does not happen.
Sorry, no clue, no patch.
/Jörg
(define (foo? s)
(let ((m '((#\space . "+"))))
(let* ((sl (string-length s))
(reuse #t)
(nl (let loop ((i 0) (n 0))
(if (= i sl) n
(loop (+ i 1)
(+ n (let ((r (assq (string-ref s i) m)))
(if r
(begin
(set! reuse #f)
(string-length (cdr r)))
1))))))))
(if reuse s #f))))
(assert (foo? "a"))
(assert (not (foo? "a b")))
(if (foo? "a b") (exit 1))
_______________________________________________
Chicken-hackers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-hackers