gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] make-array rank check


From: Michael Koehne
Subject: [Gcl-devel] make-array rank check
Date: Sat, 5 Jun 2004 22:10:45 +0200
User-agent: Mutt/1.3.28i

Moin Camm & Paul,

  I told that the implemention of io-syntax in write-to-string showed
  a nasty GCL crash (core dumped ;) - the first solution, to reduce the
  rank of the dimensions, had been right. But Paul is of course true,
  that the bug is still there. Please backport the following side track
  from my patch to GCL 2.6.2 :

  make-array has to check for rank :

*** ../gcl-cvs/./o/array.c      Tue Jun  1 00:35:07 2004
--- ./o/array.c Fri Jun  4 02:01:25 2004
*************** DEFUN_NEW("MAKE-ARRAY1",object,fSmake_ar
*** 530,535 ****
--- 530,537 ----
         object dimensions),"")
  {   
    int rank = length(dimensions);
+   if (rank > ARRAY_RANK_LIMIT)
+       FEerror("Array rank limit exceeded.",0);
    { object x,v;
      char *tmp_alloc;
      int dim =1,i; 

  ansi-tests should know about GCL's limitations :

*** ../gcl-cvs/./ansi-tests/print-array.lsp     Tue May 25 15:05:07 2004
--- ./ansi-tests/print-array.lsp        Fri Jun  4 04:09:33 2004
***************
*** 416,422 ****
  
  (deftest print.array.multi-dim.1
    (with-standard-io-syntax
!    (loop for d in '(4 5 6 7 8 9 10 12 16 20 30 40 100 200 400 600 800 1023)
         for dims = (make-list d :initial-element 1)
         for a = (make-array dims :initial-element 0)
         for result = (with-standard-io-syntax
--- 416,424 ----
  
  (deftest print.array.multi-dim.1
    (with-standard-io-syntax
!    (loop for d in
!            #-gcl'(4 5 6 7 8 9 10 12 16 20 30 40 100 200 400 600 800 1023)
!            #+gcl'(4 5 6 7 8 9 10 12 16 20 30 40 50 63) ; max rank for GCL
         for dims = (make-list d :initial-element 1)
         for a = (make-array dims :initial-element 0)
         for result = (with-standard-io-syntax
***************
*** 433,439 ****
  
  (deftest print.array.multi-dim.2
    (with-standard-io-syntax
!    (loop for d = (+ 4 (random 1020))
         for p = (random d)
         for dims = (let ((list (make-list d :initial-element 1)))
                      (setf (elt list p) 0)
--- 435,442 ----
  
  (deftest print.array.multi-dim.2
    (with-standard-io-syntax
!    (loop for d = (+ 4 #+gcl(random 59) ; max rank 63 for GCL
!                     #-gcl(random 1020))
         for p = (random d)
         for dims = (let ((list (make-list d :initial-element 1)))
                      (setf (elt list p) 0)

bye Michael
-- 
  mailto:address@hidden             UNA:+.? 'CED+2+:::Linux:2.4.22'UNZ+1'
  http://www.xml-edifact.org/           CETERUM CENSEO WINDOWS ESSE DELENDAM




reply via email to

[Prev in Thread] Current Thread [Next in Thread]