Opened 5 years ago

Closed 5 years ago

#1360 closed defect (fixed)

Miscompilation on ARM

Reported by: ivan4th Owned by: gb
Priority: normal Milestone:
Component: other Version: trunk
Keywords: Cc:

Description

CCL trunk, distilled from ITERATE load error. Note (BOUNDP 'VERSION) instead of "Current version of Iterate", DOC variable gets mixed up with another value.

CL-USER> (defun zzz (WHOLE ENVIRON)
           (DECLARE
            (IGNORABLE WHOLE ENVIRON))
           (BLOCK DEFCONST
             (LET* ((ARGS
                      (CCL::PREPARE-TO-DESTRUCTURE
                       (CDR WHOLE)
                       '(NAME VALUE &OPTIONAL DOC)
                       2
                       3))
                    (NAME (POP ARGS))
                    (VALUE (POP ARGS))
                    (DOC
                      (IF
                       ARGS
                       (POP ARGS)
                       'NIL)))
               
               (LIST*
                'UNLESS
                (LIST*
                 (LIST*
                  'BOUNDP
                  (LIST (LIST* 'QUOTE (LIST NAME))))
                 (LIST
                  (IF
                   DOC
                   (LIST*
                    'DEFCONSTANT
                    (LIST*
                     NAME
                     (LIST* VALUE (LIST DOC))))
                   (LIST*
                    'DEFCONSTANT
                    (LIST*
                     NAME
                     (LIST VALUE))))))))))
ZZZ
CL-USER> (print (zzz '(defconst version "1.4" "Current version of Iterate") nil))
(UNLESS (BOUNDP 'VERSION) (DEFCONSTANT VERSION "1.4" (BOUNDP 'VERSION)))

Original macro:

(defmacro defconst (name value &optional doc)
   `(eval-when (:compile-toplevel :load-toplevel :execute)
      (unless (boundp ',name)
        ,(if doc
             `(defconstant ,name ,value ,doc)
           `(defconstant ,name ,value)))))

Change History (2)

comment:1 Changed 5 years ago by gb

  • Owner set to gb
  • Status changed from new to assigned

comment:2 Changed 5 years ago by gb

  • Resolution set to fixed
  • Status changed from assigned to closed

Seems to have been fixed in the trunk in 16747.

Note: See TracTickets for help on using tickets.