Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
cmucl
cmucl
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 25
    • Issues 25
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 1
    • Merge Requests 1
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • cmucl
  • cmuclcmucl
  • Issues
  • #10

Closed
Open
Opened Oct 17, 2015 by Raymond Toy@rtoyOwner

(setf aref) on (simple-array (unsigned-byte 4) (*)) with constant index is incorrect.

From a bug report from Matt Kaufmann on cmucl-help, 2015-10-16:

; (declaim (optimize (safety 0))) ; safety 1 doesn't show the bug
; (load "bug.lsp")
; (compile-file "bug.lsp")
; (quit)
; ; Start cmucl again.  Then:
; (load "bug.sse2f")
; (update-problem-stack-depth 1 *the-live-$sat*)
; ; The return value is #(#(0)) but should be #(#(1)).

(in-package "CL-USER")

(declaim (optimize (safety 0)))

(defun update-problem-stack-depth (v $sat)
  (declare (type (integer 0 5) v))
  (progn
   (setf (aref (the (simple-array (integer 0 5) (1))
                    (svref $sat 0))
               0)
         (the (integer 0 5) v))
   $sat))

(defparameter *the-live-$sat*
  (coerce
   (list
    (make-array 1
                :element-type '(integer 0 5)
                :initial-element '0))
   'vector))

It's enough to compile the example with (safety 0) and load it. No need to quit and then load the fasl.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: cmucl/cmucl#10