use COMPONENT-TOPLEVELISH-P in CHECK-CONSISTENCY
authorNikodemus Siivola <nikodemus@random-state.net>
Thu, 8 Dec 2011 15:50:58 +0000 (17:50 +0200)
committerNikodemus Siivola <nikodemus@random-state.net>
Thu, 8 Dec 2011 15:50:58 +0000 (17:50 +0200)
 Fixes lp#308921 -- bug was in the consistency checking, not the compiler
 itself.

src/compiler/debug.lisp
tests/compiler.impure.lisp

index 15d3008..2997e90 100644 (file)
      (let ((leaf (ref-leaf node)))
        (when (functional-p leaf)
          (if (eq (functional-kind leaf) :toplevel-xep)
-             (unless (eq (component-kind (block-component (node-block node)))
-                         :toplevel)
+             (unless (component-toplevelish-p (block-component (node-block node)))
                (barf ":TOPLEVEL-XEP ref in non-top-level component: ~S"
                      node))
              (check-fun-reached leaf node)))))
index 38690b4..230c2d0 100644 (file)
     (assert (equal type1 (sb-kernel:%simple-fun-type g)))
     (assert (equal type0 (sb-kernel:%simple-fun-type h)))))
 
+(test-util:with-test (:name :bug-308921)
+  (let ((*check-consistency* t))
+    (ctu:file-compile
+     `((let ((exported-symbols-alist
+               (loop for symbol being the external-symbols of :cl
+                     collect (cons symbol
+                                   (concatenate 'string
+                                                "#"
+                                                (string-downcase symbol))))))
+         (defun hyperdoc-lookup (symbol)
+           (cdr (assoc symbol exported-symbols-alist)))))
+     :load nil)))
+
 ;;; success