missing destructive modification of constant warning

Bug #1736766 reported by Douglas Katzman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

(SETF AREF)warns:

* (compile nil '(lambda () (let ((a #(1 2))) (rotatef (aref a 0) (aref a 1)))))
; in: LAMBDA ()
; (ROTATEF (AREF A 0) (AREF A 1))
; --> LET* MULTIPLE-VALUE-BIND LET MULTIPLE-VALUE-BIND LET FUNCALL
; --> SB-C::%FUNCALL
; ==>
; ((SETF AREF) #:NEW1 #:A0 0)
;
; caught WARNING:
; Destructive function (SETF AREF) called on constant data.
; See also:
; The ANSI Standard, Special Operator QUOTE
; The ANSI Standard, Section 3.2.2.3

; ==>
; ((SETF AREF) #:NEW1 #:A1 1)
...

And BIT, SBIT, CHAR, SCHAR all warn.

(SETF SVREF) does not:
* (compile nil '(lambda () (let ((a #(1 2))) (rotatef (svref a 0) (svref a 1)))))
#<FUNCTION (LAMBDA ()) {1001AB803B}>

Stas Boukarev (stassats)
Changed in sbcl:
assignee: nobody → Stas Boukarev (stassats)
Revision history for this message
Stas Boukarev (stassats) wrote :

a2b08b21972dda2654cb40fdb1c6ac0fd75f76ff

Changed in sbcl:
status: New → Fix Committed
assignee: Stas Boukarev (stassats) → nobody
Stas Boukarev (stassats)
Changed in sbcl:
status: Fix Committed → 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.