Bad code deletion note inside LOOP stepping clauses

Bug #998946 reported by Stas Boukarev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Triaged
Low
Unassigned

Bug Description

(defun foo (object)
  (if (consp object)
      (loop for cdr = object then (cdr cdr)
            for car = (if (consp cdr)
                          (car cdr)
                          cdr)
            for i = 1 then (1+ i)
            while cdr
            do (print (list i car)))))

complains about the second leg of IF, since i variable has both initial and THEN clauses, car variable handling is compiled in two pieces to. And when it's initialized the type of cdr is know to be a cons.

Stas Boukarev (stassats)
tags: added: deletion-note
Revision history for this message
Attila Lendvai (attila-lendvai) wrote :

this seems to have been fixed meanwhile.

C-c C-c'ing it in slime doesn't give me any notes/warnings.

> (lisp-implementation-version)

"1.3.8.46.hu.dwim.4-da817a7"

Changed in sbcl:
status: Triaged → Fix Released
Revision history for this message
Stas Boukarev (stassats) wrote :

It's just mutated

(defun foo (object)
  (declare (cons object))
  (loop for cdr = object then (cdr cdr)
        for car = (if (consp cdr)
                      (car cdr)
                      cdr)
        for i = 1 then (1+ i)
        while cdr
        do (print (list i car))))

Changed in sbcl:
status: Fix Released → Triaged
Revision history for this message
Paul F. Dietz (paul-f-dietz) wrote :

Neither the original nor the mutated form cause the issue now.

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.