arguments in FLET/LABELS: it might be an old Python bug which is
only exercised by the new arrangement of the SBCL compiler.)
-132:
- Trying to compile
- (DEFUN FOO () (CATCH 0 (PRINT 1331)))
- gives an error
- #<SB-C:TN '0!1> is not valid as the second argument to VOP:
- SB-C:MAKE-CATCH-BLOCK,
- since the TN's primitive type SB-VM::POSITIVE-FIXNUM doesn't allow
- any of the SCs allowed by the operand restriction:
- (SB-VM::DESCRIPTOR-REG)
- The (CATCH 0 ...) construct is bad style (because of unportability
- of EQ testing of numbers) but it is legal, and shouldn't cause an
- internal compiler error. (This error occurs in sbcl-0.6.13 and in
- 0.pre7.86.flaky7.14.)
-
135:
Ideally, uninterning a symbol would allow it, and its associated
FDEFINITION and PROCLAIM data, to be reclaimed by the GC. However,
"Return the Unix environment (\"man environ\") as a list of SIMPLE-STRINGs."
(c-strings->string-list (wrapped-environ)))
-;;; Convert as best we can from a SBCL representation of a Unix
+;;; Convert as best we can from an SBCL representation of a Unix
;;; environment to a CMU CL representation.
;;;
;;; * (UNIX-ENVIRONMENT-CMUCL-FROM-SBCL '("Bletch=fub" "Noggin" "YES=No!"))
(dolist (ref (leaf-refs var))
(derive-node-type ref type)))))
t))))))
+
+(defun check-catch-tag-type (tag)
+ (declare (type continuation tag))
+ (let ((ctype (continuation-type tag)))
+ (when (csubtypep ctype (specifier-type '(or number character)))
+ (compiler-style-warn "~@<using ~S of type ~S as a catch tag (which ~
+ tends to be unportable because THROW and CATCH ~
+ use EQ comparison)~@:>"
+ (continuation-source tag)
+ (type-specifier (continuation-type tag))))))
(defun ir2-convert-throw (node block)
(declare (type mv-combination node) (type ir2-block block))
(let ((args (basic-combination-args node)))
+ (check-catch-tag-type (first args))
(vop* throw node block
((continuation-tn node block (first args))
(reference-tn-list
;;; Set up the unwind block for these guys.
(defoptimizer (%catch ir2-convert) ((info-cont tag) node block)
+ (check-catch-tag-type tag)
(emit-nlx-start node block (continuation-value info-cont) tag))
(defoptimizer (%unwind-protect ir2-convert) ((info-cont cleanup) node block)
(emit-nlx-start node block (continuation-value info-cont) nil))
;;; tag, and link the block into the CURRENT-CATCH list
(define-vop (make-catch-block)
(:args (tn)
- (tag :scs (descriptor-reg) :to (:result 1)))
+ (tag :scs (any-reg descriptor-reg) :to (:result 1)))
(:info entry-label)
(:results (block :scs (any-reg)))
(:temporary (:sc descriptor-reg) temp)
(eval-when (:compile-toplevel :load-toplevel :execute)
,defclass-form)))
`(progn
- ;; By telling the type system at compile time about
- ;; the existence of a class named NAME, we can avoid
- ;; various bogus warnings about "type isn't defined yet".
- ,(when (and
+ ;; By telling the type system at compile time about
+ ;; the existence of a class named NAME, we can avoid
+ ;; various bogus warnings about "type isn't defined yet"
+ ;; for code elsewhere in the same file which uses
+ ;; the name of the type.
+ ,(when (and
;; But it's not so important to get rid of
;; "not defined yet" warnings during
;; bootstrapping, and machinery like
;; Later, INFORM-TYPE-SYSTEM-ABOUT-STD-CLASS is
;; called by way of LOAD-DEFCLASS (calling
;; ENSURE-CLASS-USING-CLASS) to establish the 'real'
- ;; type predicate.
+ ;; type predicate.
(inform-type-system-about-std-class ',name)))
,defclass-form))))))))
ARCH_SRC = x86-arch.c
OS_SRC = linux-os.c x86-linux-os.c os-common.c
-OS_LINK_FLAGS =
+# The "--Wl --export-dynamic" flags are here to help people
+# experimenting with callbacks from C to SBCL, by allowing linkage to
+# SBCL src/runtime/*.c symbols from C. Work on this is good, but it's
+# definitely bleeding edge and not particularly stable. In particular,
+# not only are the workarounds for the GC relocating Lisp code and
+# data unstable, but even the basic calling convention might end up
+# being unstable. Unless you want to do some masochistic maintenance
+# work when new releases of SBCL come out, please don't try to build
+# real code on this until a coherent stable interface has been added!
+OS_LINK_FLAGS = -Wl --export-dynamic
OS_LIBS = -ldl
GC_SRC = gencgc.c
(setq x nil))))
(when (and (digs) (digs)) x))))
+;;; Bug 132: The compiler used to fail to compile INTEGER-valued CATCH
+;;; tags. This was fixed by Alexey Dejneka in sbcl-0.7.1.14. (They're
+;;; still a bad idea because tags are compared with EQ, but now it's a
+;;; compiler warning instead of a failure to compile.)
+(defun foo ()
+ (catch 0 (print 1331)))
+
;;; success
(quit :unix-status 104)