Changeset 908


Ignore:
Timestamp:
Feb 16, 2005, 6:56:05 PM (17 years ago)
Author:
bryan
Message:

ccl::simple-vector-delete loses with displaced arrays with a
displaced-index-offset > 0.

the second loop (looping through the scratch bit vector) to copy
the items that survive into the new array misuses the offset with
the bit vector. this causes an array out of bounds error. instead
it should use the offset with the original array to reference the
item.

the third loop which copies the remaining items that were explicitly
excluded from the test also needs the offset to copy the right items.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lib/sequences.lisp

    r415 r908  
    10371037          ))
    10381038      (setq fill start)
    1039       (setq pos (%i+ start offset))
     1039      (setq pos start)
    10401040      (loop
    10411041        (if (eq fill fill-end) (return))
    10421042        (if (neq 1 (aref bv pos))
    10431043          (progn
    1044             (%typed-miscset subtype new-vect fill (%typed-miscref subtype vector pos))
     1044            (%typed-miscset subtype new-vect fill (%typed-miscref subtype vector (%i+ offset pos)))
    10451045            (setq fill (%i+ fill 1))))
    10461046        (setq pos (%i+ pos 1)))
     
    10481048      (loop
    10491049        (when (eq fill size) (return))
    1050           (%typed-miscset subtype new-vect fill (%typed-miscref subtype vector pos))
     1050          (%typed-miscset subtype new-vect fill (%typed-miscref subtype vector (%i+ offset pos)))
    10511051          (setq fill (%i+ fill 1)
    10521052                pos (%i+ pos 1)))
Note: See TracChangeset for help on using the changeset viewer.