Steel Bank Common Lisp

make-array transform for list dimensions fails on unknown element-type

Reported by James Kalenius on 2013-03-17
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Undecided
Unassigned

Bug Description

Reported by Kenjin on #lisp. I cut down to a smaller test case.

(defpackage #:temp-kenjin
  (:use #:cl))

(in-package #:temp-kenjin)

(defparameter *world* nil)

;(defclass tile () ())

(defun reset ()
  (setf *world* (make-array '(30 40) :element-type 'tile)))

Compiling this will get you a compile-time error about an unknown type TILE, or more specifically that upgraded-array-element-type was called on it. (This happens with the defclass uncommented because of https://bugs.launchpad.net/sbcl/+bug/310120, but that's not directly relevant.) It won't occur with say (make-array 30 :element-type 'tile) because the transform for vectors gives up if it can't determine the saetp. Since the transform for multidimensional arrays just uses the u-a-e-t'd spec for a truly-the, the fix is pretty trivial, just using * instead of the u-a-e-t if the type is unknown.

*features*

(:SWANK :QUICKLISP :SB-BSD-SOCKETS-ADDRINFO :ASDF2 :ASDF :ASDF-UNICODE :ANSI-CL
 :COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE
 :SB-EVAL :SB-SOURCE-LOCATIONS :IEEE-FLOATING-POINT :OS-PROVIDES-POLL
 :OS-PROVIDES-GETPROTOBY-R :OS-PROVIDES-SUSECONDS-T :OS-PROVIDES-BLKSIZE-T
 :OS-PROVIDES-PUTWC :OS-PROVIDES-DLADDR :OS-PROVIDES-DLOPEN :LITTLE-ENDIAN
 :LINKAGE-TABLE :MULTIPLY-HIGH-VOPS :MEMORY-BARRIER-VOPS :INLINE-CONSTANTS
 :CYCLE-COUNTER :ALIEN-CALLBACKS :STACK-ALLOCATABLE-FIXED-OBJECTS
 :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-VECTORS
 :STACK-ALLOCATABLE-CLOSURES :RAW-INSTANCE-INIT-VOPS
 :UNWIND-TO-FRAME-AND-CALL-VOP :COMPARE-AND-SWAP-VOPS :C-STACK-IS-CONTROL-STACK
 :STACK-GROWS-DOWNWARD-NOT-UPWARD :GENCGC :LARGEFILE :SB-FUTEX :SB-THREAD
 :LINUX :ELF :UNIX :X86)

sbcl --version
SBCL 1.0.57.66-5783625

I know mine's a bit old, but my patch is against what I pulled from git and it doesn't seem to have been fixed.

James Kalenius (aeshtaer) wrote :
Stas Boukarev (stassats) wrote :

commit e3b6a3e3ee72b4bee3909a1876b33bd3bf6fa596
Author: Stas Boukarev <email address hidden>
Date: Sun Mar 17 12:53:47 2013 +0400

    make-array transform error on unknown element-type.

    Check for the type to be known, otherwise give up transforming.
    Based on a patch by James Kalenius.

Changed in sbcl:
status: New → Fix Committed
Stas Boukarev (stassats) on 2013-03-31
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers