Ticket #374 (closed defect: fixed)

Opened 2 months ago

Last modified 4 days ago

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

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

Description

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

11/01/08 19:41:13 changed by gz

Ditto with just aref:

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

11/01/08 21:30:31 changed by gb

  • status changed from new to assigned.

This should be fixed in r11282/r11283/r11284.

01/03/09 12:51:20 changed by rme

  • status changed from assigned to closed.
  • resolution set to fixed.