[armedbear-ticket] [armedbear] #144: Compiler generates incorrect bytecode

armedbear armedbear-devel at common-lisp.net
Mon Mar 28 10:00:04 UTC 2011


#144: Compiler generates incorrect bytecode
-------------------------------------+--------------------------------------
 Reporter:  mevenson                 |       Owner:  ehuelsmann
     Type:  defect                   |      Status:  new       
 Priority:  major                    |   Milestone:  0.26      
Component:  compiler                 |     Version:  0.24      
 Keywords:  compiler quicklisp snmp  |  
-------------------------------------+--------------------------------------
 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))))
 }}}

-- 
Ticket URL: <http://trac.common-lisp.net/armedbear/ticket/144>
armedbear <http://common-lisp.net/project/armedbear>
armedbear


More information about the armedbear-ticket mailing list