Changeset 11867


Ignore:
Timestamp:
Mar 31, 2009, 10:38:46 AM (11 years ago)
Author:
gb
Message:

%AREF1, %ASET1: need to bounds-check in the non-simple case, and need
to type-check the index to do that.
(These have been broken - in that they quietly allow some out-of-bounds
accesses - for a long time.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/l0-array.lisp

    r10777 r11867  
    524524        (multiple-value-bind (data offset)
    525525                             (%array-header-data-and-offset v)
     526          (unless (typep i 'fixnum)
     527            (report-bad-arg i 'fixnum))
     528          (unless (and (typep i 'fixnum)
     529                       (>= (the fixnum i) 0)
     530                       (< (the fixnum i) (the fixnum (%svref v target::vectorH.physsize-cell))))
     531            (if (not (typep i 'fixnum))
     532              (report-bad-arg i 'fixnum)
     533              (%err-disp $XARROOB i v)))
    526534          (uvref data (+ offset i)))
    527535        (if (= typecode target::subtag-arrayH)
     
    537545        (multiple-value-bind (data offset)
    538546                             (%array-header-data-and-offset v)
     547          (unless (and (typep i 'fixnum)
     548                       (>= (the fixnum i) 0)
     549                       (< (the fixnum i) (the fixnum (%svref v target::vectorH.physsize-cell))))
     550            (if (not (typep i 'fixnum))
     551              (report-bad-arg i 'fixnum)
     552              (%err-disp $XARROOB i v)))
    539553          (setf (uvref data (+ offset i)) new))
    540554        (if (= typecode target::subtag-arrayH)
Note: See TracChangeset for help on using the changeset viewer.