Skip to content
Commit 12d94e20 authored by Liam M. Healy's avatar Liam M. Healy
Browse files

Fix mem-set: for aggregates, pointer is incremented by offset

Recently added test struct-values.translation.mem-aref.1 that tested
conversion of arrays of structures was failing because mem-set did not
increment the pointer by the offset amount, so it was always writing
into the first position of the array and the rest was garbage.  This
is now fixed.  

(with-foreign-object (p '(:struct struct-pair) 2)
      (setf (mem-aref p '(:struct struct-pair) 0) '(1 . 2)
            (mem-aref p '(:struct struct-pair) 1) '(3 . 4))
      (values (mem-aref p '(:struct struct-pair) 0)
              (mem-aref p '(:struct struct-pair) 1)))
(1 . 2)
(3 . 4)
parent 68ac7272
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment