Opened 12 years ago

Closed 12 years ago

#374 closed defect (fixed)

struct accessors are incorrect with struct option (:type (vector single-float))

Reported by: thomas001 Owned by: gb
Priority: normal Milestone:
Component: Compiler Version: trunk
Keywords: Cc:


Hi, i came across the following when trying to do some maths with clozure:

(defstruct (foo (:type (vector single-float))) 
  (x 0s0 :type single-float) 
  (y 0s0 :type single-float))

(defun bar (v) 
  (foo-y v))

(bar (make-foo :x 1s0 :y 1s0))
;; => 1.0907007E-40

i think the code is correct,so this is a ccl bug.

Change History (3)

comment:1 Changed 12 years ago by gz

Ditto with just aref:

? (defun test-1 (v) (aref v 1)) 
? (defun test-2 (v) (aref (the (simple-array single-float (*)) v) 1)) 
? (test-1 (make-array 2 :element-type 'single-float :initial-element 1s0)) 
? (test-2 (make-array 2 :element-type 'single-float :initial-element 1s0)) 
?  (= * **)

comment:2 Changed 12 years ago by gb

  • Status changed from new to assigned

This should be fixed in r11282/r11283/r11284.

comment:3 Changed 12 years ago by rme

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.