Re: Likely Bug in JVM backend

[email protected]
Newsgroups gmane.lisp.scheme.bigloo
Organization Inria
Message-ID <[email protected]>
Hi Joseph,

> Hello, Manuel,
> 
> When compiling the module below with either 4.3a or 4.3b for the JVM
> backend and running it, I seeing the following error:
> 
>     bigloo.bexception
>             at bigloo.foreign.jumpexit(foreign.java:4929)
>             at bigloo.runtime.Llib.bexit.unwind-stack-until!(bexit.scm)
>             at bigloo.runtime.Llib.bexit.unwind-until!(bexit.scm)
>             at vector-contains.&collection-contains?1025(vector-
>     contains.scm)
>             at vector-contains.funcall2(vector-contains.scm)
>             at vector-contains.collection-contains?(vector-contains.scm)
>             at vector-contains.main(vector-contains.scm)
>             at vector-contains.bigloo_main(vector-contains.scm)
>             at vector-contains.main(vector-contains.scm)
> 
> I don't see the error when compiling to native code or if I change the
> inline functions to regular functions.
> 
> It is not really a problem since I am able to easily code around it,
> but I thought you would appreciate hearing about it. 
> 
> 
> Thank You,
> Joseph Donaldson
> 
> ------ collection-contains.scm --------
> (module collection-contains
>        (main main))
> 
> 
> (define-inline (vector-contains? vec itm)
>    (bind-exit (found)
>       (do ((i 0 (+ i 1)))
>           ((= i (vector-length vec) (found #f)))
>           (when (equal? (vector-ref vec i) itm)
>              (found #t)))))
> 
> (define-inline (coll-string-contains? str itm)
>    (bind-exit (return)
>       (do ((i 0 (+ i 1)))
>           ((= i (string-length str) (return #f))
>            (when (equal? (string-ref str i) itm)
>               (return #t))))))
> 
> 
> (define-generic (collection-contains? obj itm)
>    (cond ((vector? obj)
>           (vector-contains? obj itm))
>          ((string? obj)
>           (coll-string-contains? obj itm))))
>    
> 
> (define (main args)
>    (print (collection-contains? '#(1 2 3) 4)))
That's indeed a bug. I will work on it as soon as possible. Thanks for
your report.

-- 
Manuel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.