Wrong result for integer comparison
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I have a strange error with SBCL 2.2.4 on GNU/Linux x86_64 when running the
test suite of the lzlib library (https:/
There is no error with SBCL 2.2.2.
The error can be reproduced with:
(ql:quickload "lzlib")
(lzlib:
debugger invoked on a LZLIB:LZLIB-ERROR in thread
#<THREAD "main thread" RUNNING {1004C30113}>:
DICTIONAR
The code the error comes from is:
(defun lzma-options (level dictionary-size match-len-limit)
(cond
[...]
((and dictionary-size match-len-limit)
(let ((min-dictionar
(cond
((not (and (integerp dictionary-size)
So it looks like the form:
(<= min-dictionary-size dictionary-size max-dictionary-
which in this case is equivalent to:
(<= 4096 8388608 536870912)
returned NIL instead of T.
The lz-min-
functions defined as:
(deftype i32 () '(signed-byte 32))
(declaim (ftype (function () i32) lz-min-
(cffi:defcfun ("LZ_min_
(declaim (ftype (function () i32) lz-max-
(cffi:defcfun ("LZ_max_
If the calls to lz-min-
in the code for lzma-options above by the values they return, or by CL
functions returning the same values, the error disappears.
Changed in sbcl: | |
assignee: | nobody → Stas Boukarev (stassats) |
status: | New → Confirmed |
Changed in sbcl: | |
status: | Confirmed → Fix Committed |
assignee: | Stas Boukarev (stassats) → nobody |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |