missing destructive modification of constant warning

Bug #1736766 reported by Douglas Katzman on 2017-12-06
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
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) on 2017-12-06
Changed in sbcl:
assignee: nobody → Stas Boukarev (stassats)
Stas Boukarev (stassats) wrote :

a2b08b21972dda2654cb40fdb1c6ac0fd75f76ff

Changed in sbcl:
status: New → Fix Committed
assignee: Stas Boukarev (stassats) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers