[Ecls-list] Another delay...

Alexander Gavrilov angavrilov at gmail.com
Mon Sep 27 18:13:33 UTC 2010


> in the release plans. This time it is the Common Lisp reader with a more or
> less serious bug report. It involves strtod(), atoi(), etc, functions are
> used by ECL which may be affected by the current C locale.
> 

Hi,

While updating hu.dwim.walker to work with the current
environment structure, I have found a serious bug in ecl:

> (defun test ()
    (let ((a 5)) 
      (declare (special a))
      (flet ((x () a))
        (let ((a 10))
          (x)))))

> (test)
5 

> (compile 'test)

> (test)
10


This happens because lexical special declarations are
not supposed to propagate to inner bindings. This appears
to fix it properly:

@@ -138,11 +138,11 @@
   (member name *global-vars* :test #'eq :key #'var-name))
 
 (defun special-variable-p (name)
   (or (si::specialp name)
       (check-global name)
-      (let ((v (cmp-env-search-var name)))
+      (let ((v (cmp-env-search-var name *cmp-env-root*)))
         ;; Fixme! Revise the declamation code to ensure whether
         ;; we also have to consider 'GLOBAL here.
         (and v (eq (var-kind v) 'SPECIAL)))))
 
 ;;;

Alexander




More information about the ecl-devel mailing list