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

Array type bug



Make-array doesn't merge the element types single-float and double-float
into long-float, for example
	(array-element-type (make-array 10 :element-type 'single-float
					:initial-element 0.0))
returns t, but the compiler does interpret a declaration of
(vector single-float) to mean (vector long-float).  The result is
compiled code that expects a (vector long-float) that make-array
doesn't provide.  The fix is probably in c/array.c:

*** /tmp/d12776	Tue Nov 29 01:34:11 1988
--- array.c	Tue Nov 29 01:13:21 1988
***************
*** 30,36
  		return(aet_fix);
  	else if (x == Sshort_float)
  		return(aet_sf);
! 	else if (x == Slong_float)
  		return(aet_lf);
  	else
  		return(aet_object);

--- 30,36 -----
  		return(aet_fix);
  	else if (x == Sshort_float)
  		return(aet_sf);
! 	else if (x == Ssingle_float || x == Sdouble_float || x == Slong_float)
  		return(aet_lf);
  	else
  		return(aet_object);

There may be other types missing (like various ways to say fixnum),
and there may be a better place to fix this (like calling
compiler::type-filter on (list 'array element-type) first).
I don't know.