mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Fix compilation of rank 0 typed array literals
* module/system/vm/assembler.scm (simple-uniform-vector?): array-length fails for rank 0 arrays; fix the shape condition. * test-suite/tests/arrays.test: test reading of #0f64(x) in compilation context.
This commit is contained in:
parent
ed6c65507a
commit
fc0e75c50d
2 changed files with 10 additions and 2 deletions
|
@ -995,7 +995,9 @@ immediate, and @code{#f} otherwise."
|
|||
(define (simple-uniform-vector? obj)
|
||||
(and (array? obj)
|
||||
(symbol? (array-type obj))
|
||||
(equal? (array-shape obj) (list (list 0 (1- (array-length obj)))))))
|
||||
(match (array-shape obj)
|
||||
(((0 n)) #t)
|
||||
(else #f))))
|
||||
|
||||
(define (statically-allocatable? x)
|
||||
"Return @code{#t} if a non-immediate constant can be allocated
|
||||
|
|
|
@ -217,7 +217,13 @@
|
|||
(with-test-prefix/c&e "array-equal?"
|
||||
|
||||
(pass-if "#s16(...)"
|
||||
(array-equal? #s16(1 2 3) #s16(1 2 3))))
|
||||
(array-equal? #s16(1 2 3) #s16(1 2 3)))
|
||||
|
||||
(pass-if "#0f64(...)"
|
||||
(array-equal? #0f64(99) (make-typed-array 'f64 99)))
|
||||
|
||||
(pass-if "#0(...)"
|
||||
(array-equal? #0(99) (make-array 99))))
|
||||
|
||||
;;;
|
||||
;;; make-shared-array
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue