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
Please register or sign in to comment