Opened 14 years ago

Closed 14 years ago

#144 closed defect (fixed)

Compiler generates incorrect bytecode

Reported by: Mark Evenson Owned by: ehuelsmann
Priority: major Milestone: 0.26
Component: compiler Version: 0.24
Keywords: compiler quicklisp snmp Cc:
Parent Tickets:

Description

In working through his snmp implementation, binghe came up with the following form for which the ABCL compiler generates incorrect bytecode, leading to a "Register 4 contains a wrong type" on attempting to load.

(defun generate-table (vars vbs non-repeaters max-repetitions)
  (declare (type fixnum non-repeaters max-repetitions))
  (let* ((var-number (list-length vars))
         (n (min non-repeaters var-number))
         (m max-repetitions)
         (r (max (- var-number n) 0))
         (real-vbs (mapcar #'(lambda (x) (coerce x 'list))
                           (coerce vbs 'list)))
         result-table)
    ;; non-repeaters
    (dotimes (i n)
      (push (pop real-vbs) result-table))
    ;; table
    (when (and (plusp m) (plusp r))
      (dotimes (i m)
        (push (let (record)
                (dotimes (j r (nreverse record))
                  (push (pop real-vbs) record)))
              result-table)))
    (values (nreverse result-table)
            (mapcar #'oid vars))))

Change History (3)

comment:1 Changed 14 years ago by Mark Evenson

Simplified form

(defun generate-table (arg)
  (declare (type fixnum arg))
  (let ((unused (mapcar #'(lambda ()) nil)))
    (dotimes (i arg) t)))

comment:2 Changed 14 years ago by Mark Evenson

Still exhibits the error

(defun generate (arg)
  (declare (type fixnum arg))
  (defun enclosed ())
  (dotimes (i arg) t))

comment:3 Changed 14 years ago by Mark Evenson

Resolution: ā†’ fixed
Status: new ā†’ closed

Fixed with r13306. How long was that there? Longer than since we split with Jā€¦

Note: See TracTickets for help on using tickets.