Steel Bank Common Lisp

bug in walk-setq in src/pcl/walk.lisp

Reported by Christophe Rhodes on 2009-11-18
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Undecided
Unassigned

Bug Description

Report from Iban HATCHONDO

 affects sbcl
 status confirmed
 tag pcl walker
 done

[Step to reproduce]

try to compile and execute the following code:

(defclass foo ()
  ((array :initarg :array)))

(defmethod bar ((foo foo))
  (with-slots (array) foo
    (declare (type (or null simple-array) array))
    (setf array (make-array 4)))
  foo)

[Result]

* (compile-file "foo.lisp")

; compiling file "/tmp/foo.lisp" (written 18 NOV 2009 02:59:57 PM):
; compiling (DEFCLASS FOO ...)
; compiling (DEFMETHOD BAR ...)
; file: /tmp/foo.lisp
; in: DEFMETHOD BAR (FOO)
; (DEFMETHOD BAR ((FOO FOO))
; (WITH-SLOTS (ARRAY) FOO
; (DECLARE (TYPE (OR NULL SIMPLE-ARRAY) ARRAY))
; (SETF ARRAY (MAKE-ARRAY 4)))
; FOO)
; --> PROGN EVAL-WHEN SB-PCL::%DEFMETHOD-EXPANDER PROGN SB-PCL::LOAD-DEFMETHOD
; --> SYMBOL-MACROLET SB-PCL::FAST-LEXICAL-METHOD-FUNCTIONS
; --> SB-PCL::BIND-FAST-LEXICAL-METHOD-FUNCTIONS LOCALLY SB-PCL::BIND-ARGS LET*
; --> LOCALLY SYMBOL-MACROLET SB-PCL::PV-BINDING SB-PCL::PV-BINDING1
; --> SB-PCL::PV-ENV LOCALLY LET BLOCK LET SYMBOL-MACROLET
; --> SB-PCL::OPTIMIZED-SET-SLOT-VALUE LET
; ==>
; `(THE ,TYPE ,SB-WALKER::VAL)
;
; caught WARNING:
; undefined variable: TYPE
;
; caught WARNING:
; undefined variable: SB-WALKER::VAL
;
; compilation unit finished
; Undefined variables:
; TYPE SB-WALKER::VAL
; caught 2 WARNING conditions

; /tmp/foo.fasl written
; compilation finished in 0:00:00.010
#P"/tmp/foo.fasl"
T
T
*

Executing it leads to:

[/tmp ] sbcl --load foo.fasl
This is SBCL 1.0.29.11.debian, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
STYLE-WARNING: Implicitly creating new generic function BAR.
* (bar (make-instance 'foo))

debugger invoked on a UNBOUND-VARIABLE in thread #<THREAD "initial thread" RUNNING {AA5E5B9}>:
  The variable TYPE is unbound.

Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

((SB-PCL::FAST-METHOD BAR (FOO))
 #(0 NIL)
 #<unavailable argument>
 #<FOO {AA74099}>)
0]

Hi,

 status fixcommitted
 done

This is fixed in sbcl-1.0.32.37.

Christophe

Changed in sbcl:
status: Confirmed → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers