Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • cmucl cmucl
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 57
    • Issues 57
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • cmucl
  • cmuclcmucl
  • Issues
  • #10
Closed
Open
Issue created 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
Time tracking