manuel-serrano / bigloo

a practical Scheme compiler
http://www-sop.inria.fr/indes/fp/Bigloo
Other
138 stars 19 forks source link

fix unexpected java exception for IndexOutOfBoundsExceptions #108

Closed donaldsonjw closed 9 months ago

donaldsonjw commented 9 months ago

When indexing outside the bounds of a vector, an unexpected java exception error is displayed. A simple example is:

      (vector-ref '#(0 1) 4)

As is seen in the c-backend , this should instead throw an &index-out-of-bounds-error which can be caught and handled. Modifying error/errorno to directly instantiate and raise the exception corrects the problem. It is unclear why the former implementation invoking the procedure index-out-of-bounds-error fails. In tracing the execution, the index-out-of-bounds-error procedure does not even seem to be executed; print statements added to the procedure are never seen.