X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fseqtran.lisp;h=0b52e48c455bd6ef9fae87518990b7aba16f9063;hb=bcd323c39d6f5f80020ba4a5d9eb8d348c6cc499;hp=ac8cd0fd14e5305b56443557a22e95686e05ebb8;hpb=41cb424785ec6daf0263acb1a6a8af9d41708990;p=sbcl.git diff --git a/src/compiler/seqtran.lisp b/src/compiler/seqtran.lisp index ac8cd0f..0b52e48 100644 --- a/src/compiler/seqtran.lisp +++ b/src/compiler/seqtran.lisp @@ -1453,20 +1453,20 @@ (when (or test key) (delay-ir1-transform node :optimize) (give-up-ir1-transform "non-trivial :KEY or :TEST")) - `(with-array-data ((bits sequence :offset-var offset) - (start start) - (end end) - :check-fill-pointer t) - (let ((p ,(if (constant-lvar-p item) - (case (lvar-value item) - (0 `(%bit-position/0 bits from-end start end)) - (1 `(%bit-position/1 bits from-end start end)) - (otherwise - (abort-ir1-transform))) - `(%bit-position (the bit item) bits from-end start end)))) - (if p - (values item (the index (- (truly-the index p) offset))) - (values nil nil))))) + (catch 'not-a-bit + `(with-array-data ((bits sequence :offset-var offset) + (start start) + (end end) + :check-fill-pointer t) + (let ((p ,(if (constant-lvar-p item) + (case (lvar-value item) + (0 `(%bit-position/0 bits from-end start end)) + (1 `(%bit-position/1 bits from-end start end)) + (otherwise (throw 'not-a-bit `(values nil nil)))) + `(%bit-position item bits from-end start end)))) + (if p + (values item (the index (- (truly-the index p) offset))) + (values nil nil)))))) (deftransform %find-position ((item sequence from-end start end key test) (character string t t t function function)