mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Fix compilation of literal bitvectors.
* libguile/arrays.c (scm_from_contiguous_typed_array): Fix BYTE_LEN sanity check for bitvectors. * test-suite/tests/unif.test ("syntax")["bitvector is self-evaluating"]: New test. * module/ice-9/deprecated.scm (#\y): Fix deprecation comment: `#*' is not a read syntax.
This commit is contained in:
parent
29553c54b5
commit
cd48c32cf4
3 changed files with 8 additions and 4 deletions
|
@ -243,7 +243,8 @@ scm_from_contiguous_typed_array (SCM type, SCM bounds, const void *bytes,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (rlen * (sz / 8) + rlen * (sz % 8) / 8 != byte_len)
|
||||
/* byte_len ?= ceil (rlen * sz / 8) */
|
||||
if (byte_len != (rlen * sz + 7) / 8)
|
||||
SCM_MISC_ERROR ("byte length and dimensions do not match", SCM_EOL);
|
||||
}
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@
|
|||
#\y
|
||||
(lambda (c port)
|
||||
(issue-deprecation-warning
|
||||
"The `#y' bitvector syntax is deprecated. Use `#*' instead.")
|
||||
"The `#y' bitvector syntax is deprecated. Use `bitvector' instead.")
|
||||
(let ((x (read port)))
|
||||
(cond
|
||||
((list? x)
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
(define-module (test-suite test-unif)
|
||||
#:use-module ((system base compile) #:select (compile))
|
||||
#:use-module (test-suite lib))
|
||||
|
||||
;;;
|
||||
|
@ -546,8 +547,10 @@
|
|||
(eq? 'b (array-ref a -2)))))
|
||||
|
||||
(pass-if-exception "negative length" exception:length-non-negative
|
||||
(with-input-from-string "'#1:-3(#t #t)" read)))
|
||||
(with-input-from-string "'#1:-3(#t #t)" read))
|
||||
|
||||
(pass-if "bitvector is self-evaluating"
|
||||
(equal? (compile (bitvector)) (bitvector))))
|
||||
|
||||
;;;
|
||||
;;; equal? with vector and one-dimensional array
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue