Changeset 5537


Ignore:
Timestamp:
Nov 9, 2006, 11:50:34 AM (18 years ago)
Author:
Gary Byers
Message:

Always check that array-ctype's dimensions are a list before taking their
length.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/compiler/X86/x862.lisp

    r5533 r5537  
    77267726         (atype (if (array-ctype-p ctype) ctype))
    77277727         (keyword (and atype
    7728                            (= 2 (length (array-ctype-dimensions atype)))
    7729                            (not (array-ctype-complexp atype))
    7730                            (funcall
    7731                             (arch::target-array-type-name-from-ctype-function
    7732                              (backend-target-arch *target-backend*))
    7733                             atype))))
     7728                       (let* ((dims (array-ctype-dimensions atype)))
     7729                         (and (typep dims 'list)
     7730                             
     7731                              (= 2 (length dims))))
     7732                       (not (array-ctype-complexp atype))
     7733                       (funcall
     7734                        (arch::target-array-type-name-from-ctype-function
     7735                         (backend-target-arch *target-backend*))
     7736                        atype))))
    77347737    (cond (keyword
    77357738           (let* ((dims (array-ctype-dimensions atype))
     
    78157818         (atype (if (array-ctype-p ctype) ctype))
    78167819         (keyword (and atype
    7817                            (= 2 (length (array-ctype-dimensions atype)))
    7818                            (not (array-ctype-complexp atype))
    7819                            (funcall
    7820                             (arch::target-array-type-name-from-ctype-function
    7821                              (backend-target-arch *target-backend*))
    7822                             atype))))
     7820                       (let* ((dims (array-ctype-dimensions atype)))
     7821                         (and (type dims 'list)
     7822                              (= 2 (length dims))))
     7823                       (not (array-ctype-complexp atype))
     7824                       (funcall
     7825                        (arch::target-array-type-name-from-ctype-function
     7826                         (backend-target-arch *target-backend*))
     7827                        atype))))
    78237828    (cond (keyword
    78247829           (let* ((dims (array-ctype-dimensions atype))
     
    78857890                                         new ($ x8664::arg_z))
    78867891           (x862-pop-register seg ($ x8664::temp1))
    7887            (x862-fixed-call-builtin seg vreg xfer nil (subprim-name->offset '.SParef3))))))
     7892           (x862-fixed-call-builtin seg vreg xfer nil (subprim-name->offset '.SPaset3))))))
    78887893
    78897894
     
    78957900         (dim1 (acode-fixnum-form-p dim1)))
    78967901    (x862-aset2 seg vreg xfer arr i j new safe type-keyword dim0 dim1)))
     7902
     7903
     7904(defx862 x862-%aset3 simple-typed-aset3 (seg vreg xfer typename arr i j k new &optional dim0 dim1 dim2)
     7905  (let* ((type-keyword (x862-immediate-operand typename))
     7906         (fixtype (nx-lookup-target-uvector-subtag type-keyword))
     7907         (safe (unless *x862-reckless* fixtype))
     7908         (dim0 (acode-fixnum-form-p dim0))
     7909         (dim1 (acode-fixnum-form-p dim1))
     7910         (dim2 (acode-fixnum-form-p dim2)))
     7911    (x862-aset3 seg vreg xfer arr i j k new safe type-keyword dim0 dim1 dim2)))
    78977912
    78987913(defx862 x862-%typed-uvref %typed-uvref (seg vreg xfer subtag uvector index)
Note: See TracChangeset for help on using the changeset viewer.