Issue: improper insistence on fixnum type #171

Gilbert Baumann <[email protected]>
Newsgroups gmane.lisp.openmcl.devel
Message-ID <[email protected]>
Hello,

I looked into before-mentioned issue on github. The smallest test case
exposing this bug that I could find is like the following:

    (DEFUN BUG ()
      (DECLARE (OPTIMIZE (SPEED 1) (SAFETY 3) (DEBUG 1) (COMPILATION-SPEED 0)))
      (LET ((X 0))
        (LABELS ((FOO () (1+ X)))
          (SETQ X PI)
          (1+ X))))

I get

    (bug)
    => #<BOGUS object @ #x302001E0E255>

Which is bad. It goes away with (COMPILATION-SPEED 3). Remove the
LABELS and the bug disappears.

I nailed that down to the following change:
<https://github.com/Clozure/ccl/commit/bed5cf811ae157298903036276c079e336ae1cf9>

    diff --git a/compiler/nx0.lisp b/compiler/nx0.lisp
    index 110c6c41..15101941 100644
    --- a/compiler/nx0.lisp
    +++ b/compiler/nx0.lisp
    @@ -1599,7 +1599,7 @@ Or something. Right? ~s ~s" var varbits))
                (with-program-error-handler (lambda (c) (runtime-program-error-form c))
                  (parse-body (%cddr lambda-form) *nx-lexical-environment* t))
               (setf (afunc-acode p) (nx1-lambda (%cadr lambda-form) body decls)))))
    -
    +    (rewrite-acode-form (afunc-acode p))
         (nx1-transitively-punt-bindings *nx-punted-vars*)
         (setf (afunc-blocks p) *nx-blocks*)
         (setf (afunc-tags p) *nx-tags*)

I suggest until we find the real issue with REWRITE-ACODE-FORM, we
disable it, if we can.

-- 
Gilbert.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.