From ddbf20185514c54cb51c881d0bf2429b113b7fd7 Mon Sep 17 00:00:00 2001 From: Stas Boukarev Date: Mon, 21 Sep 2015 20:03:56 +0300 Subject: [PATCH] ARM64: fix array allocation. Properly calculate array size, don't rely on n-fixnum-tag-bits being equal to word-shift. --- src/assembly/arm64/array.lisp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/assembly/arm64/array.lisp b/src/assembly/arm64/array.lisp index c675f5418..dc09b4ed7 100644 --- a/src/assembly/arm64/array.lisp +++ b/src/assembly/arm64/array.lisp @@ -37,9 +37,9 @@ ;; This still uses the normal :return-style, BX LR, since the call ;; to do_pending_interrupt interrupt is conditional. (pseudo-atomic (pa-flag :link nil) - ;; boxed words == unboxed bytes - (inst add ndescr words (* (1+ vector-data-offset) n-word-bytes)) - (inst and ndescr ndescr (bic-mask lowtag-mask)) + (inst lsl ndescr words (- word-shift n-fixnum-tag-bits)) + (inst add ndescr ndescr (* (1+ vector-data-offset) n-word-bytes)) + (inst and ndescr ndescr (bic-mask lowtag-mask)) ; double-word align (allocation vector ndescr other-pointer-lowtag :flag-tn pa-flag) (inst lsr ndescr type n-fixnum-tag-bits) (storew ndescr vector 0 other-pointer-lowtag) @@ -69,9 +69,9 @@ (:temp vector descriptor-reg r8-offset)) ;; See why :LINK NIL is needed in ALLOCATE-VECTOR-ON-HEAP above. (pseudo-atomic (pa-flag :link nil) - ;; boxed words == unboxed bytes - (inst add ndescr words (* (1+ vector-data-offset) n-word-bytes)) - (inst and ndescr ndescr (bic-mask lowtag-mask)) + (inst lsl ndescr words (- word-shift n-fixnum-tag-bits)) + (inst add ndescr ndescr (* (1+ vector-data-offset) n-word-bytes)) + (inst and ndescr ndescr (bic-mask lowtag-mask)) ; double-word align (allocation vector ndescr other-pointer-lowtag :flag-tn pa-flag :stack-allocate-p t) -- 2.11.4.GIT