#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)))) }}}
#144: Compiler generates incorrect bytecode -----------------------+---------------------------------------------------- Reporter: mevenson | Owner: ehuelsmann Type: defect | Status: new Priority: major | Milestone: 0.26 Component: compiler | Version: 0.24 Resolution: | Keywords: compiler quicklisp snmp -----------------------+----------------------------------------------------
Comment(by mevenson):
Simplified form
{{{ (defun generate-table (arg) (declare (type fixnum arg)) (let ((unused (mapcar #'(lambda ()) nil))) (dotimes (i arg) t))) }}}
#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 | -------------------------------------+--------------------------------------
Comment(by mevenson):
Still exhibits the error
{{{ (defun generate (arg) (declare (type fixnum arg)) (defun enclosed ()) (dotimes (i arg) t)) }}}
#144: Compiler generates incorrect bytecode -----------------------+---------------------------------------------------- Reporter: mevenson | Owner: ehuelsmann Type: defect | Status: closed Priority: major | Milestone: 0.26 Component: compiler | Version: 0.24 Resolution: fixed | Keywords: compiler quicklisp snmp -----------------------+---------------------------------------------------- Changes (by mevenson):
* status: new => closed * resolution: => fixed
Comment:
Fixed with r13306. How long was that there? Longer than since we split with J…
armedbear-ticket@common-lisp.net