Undefined behaviour in defstruct use
Bug #1866493 reported by
Karsten Poeck
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
sbcl seem to rely on undefined behaviour in its use of defstructs with constuctors that don't initialize all slots (sbcl seem to assume that these slots are initialized to nil).
Example:
(defstruct (hugo (:constructor make-hugo (a))) a b)
(hugo-b (make-hugo 23))
returns nil in sbcl but #:UNBOUND in clasp (and I believe clasp is within the standard doing this)
This - potentially wrong - pattern is used in the sbcl code base in 5 places.
The attached patched explicitely initializes the slots to nil not covered in the constructor.
Did self build sbcl and run all tests (sucessfull).
affects: | sbcl (Ubuntu) → sbcl |
To post a comment you must log in.
The attachment "Patch defstruct use undefined behaviour" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.
[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]