Undefined behaviour in defstruct use

Bug #1866493 reported by Karsten Poeck
8
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).

Tags: patch
Revision history for this message
Karsten Poeck (kpoeck) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

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.]

tags: added: patch
Revision history for this message
Karsten Poeck (kpoeck) wrote :

I did report this in the wrong project, should have been sbcl upstream

affects: sbcl (Ubuntu) → sbcl
Revision history for this message
Christophe Rhodes (csr21-cantab) wrote :

Looks to me like this was merged as 1234d9e4b6155fa31364d2a279249bad4e29f615

Changed in sbcl:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.