Changeset 261


Ignore:
Timestamp:
Jan 11, 2004, 5:53:00 PM (21 years ago)
Author:
Gary Byers
Message:

ARRAY-IN-BOUNDS-P allows bignum subscripts (which are never in bounds,
of course.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lib/arrays-fry.lisp

    r85 r261  
    397397  (let ((rank  (array-rank array))
    398398        (nsubs (%lexpr-count subscripts)))
    399     (declare (fixnum sum rank))   
     399    (declare (fixnum nsubs rank))   
    400400    (if (not (eql nsubs rank))
    401401      (%err-disp $xndims array nsubs)
     
    405405              (dim (array-dimension array i) (array-dimension array i)))
    406406             (nil)
    407           (declare (fixnum i))
     407          (declare (fixnum i dim))
    408408          (let ((s  (%lexpr-ref subscripts nsubs i)))
    409             (require-type s 'fixnum)
    410             (if (or (< s 0)(>= s dim)) (return nil))
     409            (if (typep s 'fixnum)
     410              (locally (declare (fixnum s))
     411                (if (or (< s 0)(>= s dim)) (return nil)))
     412              (if (typep s 'bignum)
     413                (return nil)
     414                (report-bad-arg s 'integer)))
    411415            (when (eql i 0) (return t))))))))
    412416
Note: See TracChangeset for help on using the changeset viewer.