Hi,


I’ve encountered a segmentation fault in s7 triggered by the following code:



```

;; This is a `filter` function from SRFI-1

(define (filter pred l)

  (let recur ((l l))

    (if (null? l) l

        (let ((head (car l))

              (tail (cdr l)))

          (if (pred head)

              (let ((new-tail (recur tail)))

                (if (eq? tail new-tail) l

                    (cons head new-tail)))

              (recur tail))))))



(define func (lambda (x) #t))

(filter func (make-list 100000 1))

```



I’ve looked into it a bit. When s7 is compiled with `S7_DEBUGGING=1`, the issue 
doesn’t occur—presumably because an additional `resize_stack_unchecked` call is 
made before actually `push_stack`, which seems to prevent the crash.



Let me know if you’d like any additional info or if I can help further.



Regards,

Jim Zhou
_______________________________________________
Cmdist mailing list
[email protected]
https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Reply via email to