DESCRIBE called with string as second argument mutates that string

Bug #1903901 reported by Michał "phoe" Herda
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

SBCL 2.0.10 on Linux amd64.

Found by zulu.inuoe.

DESCRIBE, when called with a string as its second argument, sometimes first mutates the string and only then signals a type error.

Example of a type error getting signaled at the beginning:

(let ((str (make-array 256 :element-type 'character :fill-pointer 0)))
  (describe 'describe str))

Examples of incorrect behavior:

----------------------

(describe 'describe (make-array 256 :element-type 'character :fill-pointer 0))

;=> The value
  "COMMON-LISP:DESCRIBE
  [symbol]
"

is not of type
  STREAM
   [Condition of type TYPE-ERROR]

--------------

(defun foo ()
  (make-array 256 :element-type 'character :fill-pointer 0))

(let ((str (foo)))
  (ignore-errors (describe 'describe str))
  (print str))

;=> "COMMON-LISP:DESCRIBE
  [symbol]
"

summary: - DESCRIBE called with string argument mutates the string
+ DESCRIBE called with string as second argument mutates that string
Douglas Katzman (dougk)
Changed in sbcl:
status: New → Fix Committed
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.