Skip to content
Snippets Groups Projects
Forked from cmucl / cmucl
Source project has a limited visibility.
  • toy's avatar
    7fbf5590
    Port over SBCL's fix for the Entomotomy bug · 7fbf5590
    toy authored
    array-element-type-treated-as-declaration
    
    wherein the compiler believes type declarations on array elements
    without checking them, e.g.
    
    	(DECLAIM (OPTIMIZE (SAFETY 3) (SPEED 1) (SPACE 1)))
    	(DEFSTRUCT FOO A B)
    	(DEFUN BAR (X)
    	  (DECLARE (TYPE (SIMPLE-ARRAY CONS 1) X))
    	  (WHEN (CONSP (AREF X 0))
    	    (PRINT (AREF X 0))))
    	(BAR (VECTOR (MAKE-FOO :A 11 :B 12)))
    
    prints a structure out.
    
    This patch makes the compiler use the specialized (upgraded) element
    type instead of the declared element type for aref.
    7fbf5590
    History
    Port over SBCL's fix for the Entomotomy bug
    toy authored
    array-element-type-treated-as-declaration
    
    wherein the compiler believes type declarations on array elements
    without checking them, e.g.
    
    	(DECLAIM (OPTIMIZE (SAFETY 3) (SPEED 1) (SPACE 1)))
    	(DEFSTRUCT FOO A B)
    	(DEFUN BAR (X)
    	  (DECLARE (TYPE (SIMPLE-ARRAY CONS 1) X))
    	  (WHEN (CONSP (AREF X 0))
    	    (PRINT (AREF X 0))))
    	(BAR (VECTOR (MAKE-FOO :A 11 :B 12)))
    
    prints a structure out.
    
    This patch makes the compiler use the specialized (upgraded) element
    type instead of the declared element type for aref.