[Openmcl-devel] psetf issue on Linux|Windows X8632

Shannon Spires svs at bearlanding.com
Wed Apr 12 12:28:23 PDT 2017


I can reproduce it on my Mac in CCL32, but not CCL64. Furthermore, it only happens in CCL32 when safety is 1 or 0.

(defstruct vec
  (x 0.0 :type single-float)
  (y 0.0 :type single-float))

; Following has the psetf form macroexpanded for greater clarity:

(defun test ()
  (declare (optimize (safety 1))) ; no error when 2 or 3
  (let ((vec (make-vec)))
    (PROGN (LET ((foo (CCL::STRUCTURE-TYPECHECK VEC VEC)))
             (MULTIPLE-VALUE-BIND (bar)
                                  5.0
               (PROGN (SETF (VEC-Y VEC) 5.0)
                 (THE SINGLE-FLOAT
                      (LET ((bar (CCL::TYPECHECK bar SINGLE-FLOAT)))
                        (CCL::STRUCT-SET foo 1 bar))))))
      vec)))

(test)


On Apr 12, 2017, at 9:48 AM, Ron Garret wrote:

> Seems to be Windows-specific.  I can’t reproduce this on my mac.
> 
> On Apr 12, 2017, at 2:30 AM, Nicolas Hafner <shinmera at tymoon.eu> wrote:
> 
>> This case can be further reduced to the following, which does not require the library:
>> 
>> 
>> (defstruct vec
>>   (x 0.0 :type single-float)
>>   (y 0.0 :type single-float))
>> 
>> (let ((vec (make-vec)))
>>   (psetf (vec-x vec) 5.0
>>          (vec-y vec) 5.0))
>> 
>> The specific trigger combination seems to be psetf with typed structure slots.
>> 
>> On 12/04/17 11:20, gzip4 wrote:
>>> Hello, All!
>>> 
>>> To reproduce the issue:
>>> 
>>> 
>>> (lisp-implementation-version)
>>> "Version 1.11-r16635  (WindowsX8632)"
>>> 
>>> (ql:quickload '3d-vectors)
>>> 
>>> (let ((vec (3d-vectors::vec 5 0 0)))
>>>   (psetf (3d-vectors::%vx3 vec) 5.0
>>>          (3d-vectors::%vy3 vec) 5.0))
>>> 
>>> Signal error:
>>> The value 5.0 is not of the expected type STRUCTURE.
>>> [Condition of type TYPE-ERROR]
>>> 
>>> The problem seems to be related to psetf. If you remove one of the set pairs, it works fine. If you use setf, it also works fine.
>>> 
>>> 64 bit versions do not have such an issue, LinuxARM32 also passes.
>>> 
>>> -- 
>>> gzip4
>> 
>> _______________________________________________
>> Openmcl-devel mailing list
>> Openmcl-devel at clozure.com
>> https://lists.clozure.com/mailman/listinfo/openmcl-devel
> 
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> https://lists.clozure.com/mailman/listinfo/openmcl-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20170412/b884c4ee/attachment.htm>


More information about the Openmcl-devel mailing list