FIND / POSITION on lists does not signal bounding-indices-bad-error
Bug #452008 reported by
Attila Lendvai
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Unassigned |
Bug Description
TEST> (count :foo '(1 2 3 :foo) :start 4 :end 0)
; Evaluation aborted
TEST> (find :foo '(1 2 3 :foo) :start 4 :end 0)
NIL
TEST> (position :foo '(1 2 3 :foo) :start 4 :end 0)
NIL
as reported by Tobias C. Rittweiler on sbcl-devel.
Changed in sbcl: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
summary: |
- FIND / POSITION do not signal bounding-indices-bad-error + FIND / POSITION on lists does not signal bounding-indices-bad-error |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Hi,
I send in attach a patch that fixes this issue. I've tested with some examples and it works as required (unless I forgot some special case). In short, the macrolet in src/compiler/ seqtran. lisp for these functions was just checking the indices in the result part of dolist. This allowed the error to occur since it did not catch all the possibilities. The patch makes the indices check before the dolist is executed.
This is the first time I've looked at the SBCL source code and made a patch. If I am doing something wrong or not the correct way, I apologize in advance.
Cheers,