Commit ac2964f3 by Arthur Lemmens

Don't assume that non-simple strings always have fill-pointers when …

Don't assume that non-simple strings always have fill-pointers when  serializing. Thanks to pixel@kepibu.org.
parent 2e846310
* 2011-06-20 - version 0.1.21
Fix a bug reported by pixel@kepibu.org: don't assume that non-simple
strings always have fill-pointers when serializing.
* 2009-05-27 - version 0.1.20
Fix a bug in the creation of transaction-ids (bug reported by Klaus
......
;;; $Id: rucksack.asd,v 1.20 2008-03-02 22:29:05 alemmens Exp $
;;; $Id: rucksack.asd,v 1.21 2009/05/27 14:26:25 alemmens Exp $
(in-package :cl-user)
(asdf:defsystem :rucksack
:version "0.1.20"
:version "0.1.21"
:serial t
:components ((:file "queue")
(:file "package")
......
;; $Id: serialize.lisp,v 1.9 2007/01/20 18:17:55 alemmens Exp $
;; $Id: serialize.lisp,v 1.10 2007/01/22 10:23:14 alemmens Exp $
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Serialize
......@@ -905,7 +905,9 @@ implementation-dependent attributes."
type)))))
(serialize-marker type-marker stream))
(unless simple-p
(serialize (fill-pointer string) stream)
(serialize (and (array-has-fill-pointer-p string)
(fill-pointer string))
stream)
(serialize (adjustable-array-p string) stream))
(serialize (length string) stream)
(loop for char across string
......
;; $Id: test.lisp,v 1.1 2008/01/23 15:49:07 alemmens Exp $
;; $Id: test.lisp,v 1.2 2008/02/11 12:47:53 alemmens Exp $
(in-package :rucksack-test)
......@@ -42,6 +42,14 @@
(test (not (current-rucksack)))
;; Non-simple strings without fill-pointers should be serialized without any problems.
(let ((str (make-array '(0)
:element-type 'character
:adjustable t
:fill-pointer nil)))
(p-test (p-list str)
(equal "" (p-car it))))
;;
;; P-CONS, P-CAR, P-CDR, P-LIST, P-MAKE-ARRAY, P-AREF
;;
......@@ -59,7 +67,6 @@
(equal '(a b)
(list (p-aref it 0) (p-aref it 1))))
;;
;; Persistent-objects
;;
......
Markdown is supported
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